File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/**
2- * Syncs the active tab state with the block selection in the editor.
3- *
4- * When this tab item (nav-item or panel-item) is the one selected or is the
5- * closest tab item to the current block selection, updates the parent
6- * blockparty/tabs block's tabsActive attribute to this item's index.
7- *
8- * This direct link (the clicked block updates its own tabs block) ensures
9- * correct behavior with nested tabs: only the tabs block that owns the
10- * selected tab is updated.
11- *
12- * @since 1.0.6
13- *
14- * @param {Object } props Component props.
15- * @param {string } props.clientId This block's clientId (tabs-nav-item or tabs-panel-item).
16- * @return {null } Renders nothing.
17- */
2+ * Syncs the active tab state with the block selection in the editor.
3+ *
4+ * When this tab item (nav-item or panel-item) is the one selected or is the
5+ * closest tab item to the current block selection, updates the parent
6+ * blockparty/tabs block's tabsActive attribute to this item's index.
7+ *
8+ * This direct link (the clicked block updates its own tabs block) ensures
9+ * correct behavior with nested tabs: only the tabs block that owns the
10+ * selected tab is updated.
11+ *
12+ * @since 1.0.6
13+ *
14+ * @param {Object } props Component props.
15+ * @param {string } props.clientId This block's clientId (tabs-nav-item or tabs-panel-item).
16+ * @return {null } Renders nothing.
17+ */
1818import { useEffect } from '@wordpress/element' ;
1919import { useSelect , useDispatch } from '@wordpress/data' ;
2020
You can’t perform that action at this time.
0 commit comments