Closed jeffaglenn closed 6 years ago
Any idea on this?
I have found a work-around but it's not great:
I'm guessing the problem is that when icon picker is added to the DOM via a Matrix block the code in src/resources-app/js/field.js isn't rerun, so the click event listener never get's attached.
Thank you for pointing this out and glitchedmob thanks for making a solution.
I looked at the solution and because of it i found the actual problem.
The problem was that the field script tried to add an on click event handler to the iconpicker button that has to open the modal. Only this button does not yet exist when using the field in a matrix field.
I altered the script and it now works correctly. So no further need to make it a garnish class and call the class separately. Also the field scripts add's a uniq id to the buttons parent already so that is not necessary any more.
The changed code is in the newest release now. https://github.com/Dolphiq/craft3-iconpicker/releases/tag/1.0.5
Awesome, thank you!
When the Icon Picker field is within a Matrix clicking the button does nothing. The issue is discussed a little here https://github.com/Dolphiq/craft3-iconpicker/issues/7 but the title does not reflect the discussion.