Skip to content

Commit ef457a7

Browse files
committed
gutenberg-sidebar: fixed bug sidebar not closing when X button is clicked in a sidebar components-panel
Version bumped to 0.1.1
1 parent c30e9de commit ef457a7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

components/gutenberg-sidebar/js/mill3-wp-utils-gutenberg-sidebar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ const mill3WpUtilsGutenbergSidebar = () => {
4343
// find main element
4444
const ELEMENT = document.querySelector('.edit-post-layout, .edit-site-layout');
4545

46+
const CLOSE_SELECTOR = '.interface-pinned-items button, .editor-sidebar__panel-tabs button:last-child, .components-panel__header button:last-child';
47+
4648
// wait for the element to be available
4749
if(!ELEMENT) return
4850

49-
jQuery('body').on('click', '.interface-pinned-items button', mill3WpUtilsGutenbergOpenSidebar);
51+
jQuery('body').on('click', CLOSE_SELECTOR, mill3WpUtilsGutenbergOpenSidebar);
5052

5153
// open sidebar on initial load after some timeout
5254
setTimeout(mill3WpUtilsGutenbergOpenSidebar, 1000);

mill3-wp-utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: MILL3 WP Utils
44
* Plugin URI: https://github.com/Mill3/mill3-wp-utils-plugin
55
* Description: MILL3 WP Utils
6-
* Version: 0.1.0
6+
* Version: 0.1.1
77
* Author: MILL3 Studio
88
* Author URI: https://mill3.studio/
99
* Tested up to: 6.6.6

0 commit comments

Comments
 (0)