Fix [required] fields not working in Microsoft Edge with Selectize.js #1222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is achieved by adding a Selectize plugin that overrides the bugged
refreshValidityState
method in the Selectize library. This commit should be reverted if selectize/selectize.js/pull/1320 is ever merged and a new version of Selectize gets released.MS Edge is sometimes the only browser people can use in corporate environments. Even if supporting MS Edge is sometimes cumbersome it would be great if the Grav Admin Plugin would work with Edge without problems. This PR is a step towards it.
I’m aware of the fact that overriding things in external libraries is generally a bad idea. Something could break when the library is updated. But I think this is a special case because Selectize has been looking for new maintainers since 2015 (see selectize/selectize.js/issues/752) and receives only minimal attention from the original maintainer since then. Therefore it’s unlikely that this issue is fixed in Selectize itself (selectize/selectize.js/pull/1320), leaving the Admin plugin forever with this issue.
I tested the changes from this PR in Chrome and in MS Edge without problems.
Fixes #1061