-
Notifications
You must be signed in to change notification settings - Fork 276
fix(ui5-tokenizer): sync popover list items with token text changes #11854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add invalidateOnChildChange config to tokens slot to watch for text property changes to ensure popover list items automatically update when token text is modified fixes: #11825
clean the merge conflict markers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that popover list items reflect updates to token text by invalidating the slot when a child's text
property changes, and adds Cypress tests to verify this behavior.
- Added
invalidateOnChildChange
slot configuration to watch token text changes. - Introduced Cypress tests for single and multiple token text updates in the popover.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/main/src/Tokenizer.ts | Added invalidateOnChildChange to tokens slot configuration. |
packages/main/cypress/specs/Tokenizer.cy.tsx | New tests verifying popover list item text updates on token changes. |
Comments suppressed due to low confidence (1)
packages/main/src/Tokenizer.ts:336
- [nitpick] Consider adding a brief JSDoc comment above the
invalidateOnChildChange
slot config to explain its purpose (watchingtext
property changes) so future maintainers understand why this is needed.
invalidateOnChildChange: {
use the StandardListItem 'text' property instead of slot to ensure correct text rendering in popover list items
<Token text="Germany"></Token> | ||
</Tokenizer> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
select by [custom-tag] instead of id where it's possible
const token = $token.get(0) as Token; | ||
token.text = "Updated Text"; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cy.get("#token-to-modify")
.invoke("prop", "text", "Updated Text");
ListItemStandard
element and not rendered as its default slot, because after feat(ui5-li): add text wrapping support #11108 dynamic updates in it doesn't get reflected (do not cause re-rendering of the list item).Note: The problem in the ListItemStandard occurs only with
wrappingType
set toNormal
because it uses theui5-expandable-text
component. That component has its owntext
property which is getting updated when thetext
property of theListItemStandart
is updated, but not when its slot is.invalidateOnChildChange
config to tokens slot to watch for text property changes to ensure popover list items automatically update when token text is modifiedfixes: #11825