Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ndeshev
Copy link
Contributor

@ndeshev ndeshev commented Jul 4, 2025

  • The token's text now is bound to the text property of the 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 to Normal because it uses the ui5-expandable-text component. That component has its own text property which is getting updated when the text property of the ListItemStandart is updated, but not when its slot is.

  • 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

ndeshev added 3 commits July 5, 2025 01:41
- 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
Copy link
Contributor

@Copilot Copilot AI left a 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 (watching text property changes) so future maintainers understand why this is needed.
		invalidateOnChildChange: {

ndeshev added 2 commits July 5, 2025 16:22
use the StandardListItem 'text' property instead of slot
to ensure correct text rendering in popover list items
<Token text="Germany"></Token>
</Tokenizer>
);

Copy link
Contributor

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";
});

Copy link
Contributor

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");

@StefanDimitrov04 StefanDimitrov04 self-requested a review July 8, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui5-tokenizer: the list item texts in the more popover are not updated
2 participants