Closed malthemilthers closed 6 years ago
Hello @malthemilthers ,
As I've pointed out in the readme.md many of the features introduced with release 2.0.0 were the result of a collaboration. Unfortunately the developer of those features is not actively following the project anymore and so I can't possible keep up with all the changes he made. I keep using version 1.0.0 myself :)
If you wanna try to figure out where the issue is there are two points where the change event might manually be triggered to the input on line 697 and 701 of jquery.fonticonpicker.js. A fast workaround could be to discard the first event or figure out why it's triggered at all.
Cheers, Alex
Hi Alex, thank you for getting back to me. I completely understand what you're saying, and I apologise for not noticing that in the Readme.
But you actually helped me find the problem. I changed the line at 697 to check for a conditional.
if ( this.element.val() != theIcon) {
this.element.val((theIcon === '' ? this.settings.emptyIconValue : theIcon )).trigger('change');
}
I don't know if you still do changes to this repo? - would you like me to do a pull request?
Hello @malthemilthers , Thank you for your feedback. Unfortunately I won't be able to accept new PRs until some good soul steps in to write a test suite for the project but I'll leave the issue open in case someone else had the same issue.
Cheers, Alex
Alright.
Cheers, Malthe
Hello,
Thanks for pointing this out. I will look into it asap.
Hi, I have been working on implementing the icon selector to a CMS form (WordPress). When a user leaves the form-page, the system checks to see if any changes has happened to the form, and if it finds that changes has happened, it prompts the user with a "are you sure you want to leave the page..." message.
For some reason, the script changes the value from whatever is selected to the same value again, which is considered a ".change" event in Javascript, even though the value is the same. In my case this results in the warning every time someone tries to leave the form-page, even if nothing has changed at all.
Note that this is not the case in version 1.0.0, but is the case in 2.0.0.
Is there a way to get around this? Does the script have to trigger the change-event on load?
For now I have to use version 1.0.0 to get around this, but this doesn't trigger the change-warning, even if it is changed, which I don't quite understand.
Thank you for all your time building this.