Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Oct 29, 2024
1 parent bb27ecb commit 86662f6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion docs/data/tree-view/rich-tree-view/headless/headless.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const useCustomPlugin = ({ models }) => {
models.expandedItems.setValue([]);

// Check if an item is expanded
const isExpanded = instance.isNodeExpanded('some-item-id');
const isExpanded = useSelector(selectorIsItemExpanded, 'some-item-id');
};
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export const useTreeItemUtils = <
// As a side effect of `instance.focusItem` called here and in `handleCancelItemLabelEditing` the `labelInput` is blurred
// The `onBlur` event is triggered, which calls `handleSaveItemLabel` again.
// To avoid creating an unwanted behavior we need to check if the item is being edited before calling `updateItemLabel`
// using `instance.isItemBeingEditedRef` instead of `instance.isItemBeingEdited` since the state is not yet updated in this point
if (selectorIsItemBeingEdited(store.value, itemId)) {
instance.updateItemLabel(itemId, newLabel);
toggleItemEditing();
Expand Down

0 comments on commit 86662f6

Please sign in to comment.