cortexrd / Knack-Toolkit-Library

Knack Toolkit Library
MIT License
26 stars 6 forks source link

Issue with ktlTarget using jQuery containing square brackets #220

Closed CSWinnall closed 1 month ago

CSWinnall commented 9 months ago

Hi Norm

This is a fix until we update our Prod KTL 0.22.14.

I have added the below keyword instead of _ro temporarily:

_style=[display: none], [ktlTarget, $("#view_3091-field_4707 option[value='Extra Info']")]

Now I cannot see an error in the keyword above and it is working as expected, but this is in the console:

image

Any thoughts?

Craig

CSWinnall commented 9 months ago

Hi @cortexrd

After some investigation the issue is the option[value="Extra Info"], I believe this is due to the square brackets in the Jquery selector?

Craig

cortexrd commented 9 months ago

You're right Craig, good catch.

The parser gets confused due to the conflict between the square brackets of the Group delimiters and those of the jQuery selector.

I will need to add some extra logic to detect and address this use case.

Norm

CSWinnall commented 9 months ago

Thank you it's a fringe case and has been replaced with the _ro keyword so it's not in use anymore.

Craig