-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rich text editor | Fix nested list highlighting (#1462)
# Pull Request ## 🤨 Rationale Fixes #1434 - This PR fixes the behavior of list buttons in case of having nested lists. Previously for nested lists, the list buttons used to get highlighted based all all the tags preceding it.  - With this change only the list item based on last tag will get highlighted  ## 👩💻 Implementation - Used `findParentNode` method from tiptap/core to find the current node type - Highlight the list button only based on current node type ## 🧪 Testing - Added unit test for testing this use case ## ✅ Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [x] I have updated the project documentation to reflect my changes or determined no changes are needed. --------- Signed-off-by: Sai krishnan Perumal <[email protected]>
- Loading branch information
1 parent
c0350d7
commit 903a5d2
Showing
5 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@ni-nimble-components-184413cc-afcf-4db1-b373-1bdb1a98f015.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "Fix bug with rich text editor nested list button state", | ||
"packageName": "@ni/nimble-components", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* TipTap node types. | ||
* @public | ||
*/ | ||
export const TipTapNodeName = { | ||
bulletList: 'bulletList', | ||
numberedList: 'orderedList' | ||
} as const; | ||
|
||
export type TipTapNodeName = | ||
(typeof TipTapNodeName)[keyof typeof TipTapNodeName]; |