Skip to content

DateField/AutoComplete Gutenberg Patch#796

Merged
dlh01 merged 6 commits intomasterfrom
hotfix/patch-date-autocomplete-load-gutenberg
Feb 26, 2021
Merged

DateField/AutoComplete Gutenberg Patch#796
dlh01 merged 6 commits intomasterfrom
hotfix/patch-date-autocomplete-load-gutenberg

Conversation

@jomurgel
Copy link
Copy Markdown
Contributor

Closes #793.

  • Allows Autocomplete and Date fields in Gutenberg to load jQuery scripts on input focus. In the Gutenberg context fields are not enabled as the jQuery $( 'FIELD_NAME:visible' ) returns undefined, unless re-initialized as needed which prevents the need to auto-enabled ALL fields on the page (many of which are hidden by default using the display_if option).

Copy link
Copy Markdown

@isGabe isGabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐴

@dlh01
Copy link
Copy Markdown
Member

dlh01 commented Feb 26, 2021

@jomurgel Thanks!

I found that a couple more adjustments were necessary: targeting the class used directly on the input element rather than a potential group class, and using datepicker.add_datepicker rather than autocomplete.add_datepicker. I've made these changes in bddfdf0.

For both the datepicker and autocomplete updates, I also removed the initialization bound to various Fieldmanager events. I don't think those will be necessary now that the focus event triggers the same behavior.

Would you mind testing the updates?

Copy link
Copy Markdown
Member

@mslinnea mslinnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐴 Tested this on 2 different sites. It resolves issues with date picker and autocomplete in WP 5.6

@dlh01 dlh01 merged commit 5bb9263 into master Feb 26, 2021
@dlh01 dlh01 deleted the hotfix/patch-date-autocomplete-load-gutenberg branch February 26, 2021 23:45
@dlh01 dlh01 added this to the 1.4.0 milestone Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fieldmanager_Datepicker not working in WordPress 5.6 on Gutenberg Post

4 participants