Skip to content

Instantly share code, notes, and snippets.

@vishalkakadiya
Last active June 18, 2021 06:05
Show Gist options
  • Save vishalkakadiya/7d1ee4e218f3c32f6b7b717b2daef3b2 to your computer and use it in GitHub Desktop.
Save vishalkakadiya/7d1ee4e218f3c32f6b7b717b2daef3b2 to your computer and use it in GitHub Desktop.
FieldManager's Autocomplete, Datepicker and RichText_Area elements not working with Gutenberg block editor?
/**
* Below is the small trick to fix conflicts between FieldManager's Autocomplete, Datepicker and RichText_Area with Gutenberg block editor.
*/
$( window ).load( function() {
// NOTE: This is fix for fieldmanager datepicker and autocomplete.
// Ref: https://github.com/alleyinteractive/wordpress-fieldmanager/issues/713 .
if ( typeof fm !== "undefined" ) {
if ( typeof fm.datepicker !== "undefined" ) {
fm.datepicker.add_datepicker();
}
if ( typeof fm.autocomplete !== "undefined" ) {
fm.autocomplete.enable_autocomplete();
}
if ( typeof fm.richtextarea !== "undefined" ) {
fm.richtextarea.add_rte_to_visible_textareas();
}
}
} );
@yahilmadakiya
Copy link

Works Great, thank you so much!

@vishalkakadiya
Copy link
Author

vishalkakadiya commented Jun 18, 2021

Works Great, thank you so much!

@yahilmadakiya I'm glad I able to help you! 🙂

@vishalkakadiya
Copy link
Author

Added RichText Area's fix as well! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment