Skip to content
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

refactor: grid item details toggle example improvements #4001

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

sissbruecker
Copy link
Contributor

Closes #3986

@@ -25,6 +27,24 @@ function Example() {
});
}, []);

const toggleDetailsRenderer = useCallback(({ item: person }: { item: Person }) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redeclaring renderer functions every render cycle has issues at the moment (vaadin/react-components#283), so extracted this.

Comment on lines 104 to 105
? html` <vaadin-icon icon="lumo:angle-down"></vaadin-icon>`
: html` <vaadin-icon icon="lumo:angle-right"></vaadin-icon>`}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could replace this with a single icon e.g. like this:

<vaadin-icon
  .icon="${isExpanded ? 'lumo:angle-down' : 'lumo:angle-right'}"
></vaadin-icon>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, done

@sissbruecker sissbruecker requested a review from vursen December 17, 2024 14:17
@sissbruecker sissbruecker merged commit d5c4b9a into latest Dec 17, 2024
3 of 4 checks passed
@sissbruecker sissbruecker deleted the refactor/grid-details-toggle-improvements branch December 17, 2024 16:14
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.

Improve custom details toggle example in Grid docs
3 participants