-
Notifications
You must be signed in to change notification settings - Fork 201
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
refactor: grid item details toggle example improvements #4001
Conversation
@@ -25,6 +27,24 @@ function Example() { | |||
}); | |||
}, []); | |||
|
|||
const toggleDetailsRenderer = useCallback(({ item: person }: { item: Person }) => { |
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.
Redeclaring renderer functions every render cycle has issues at the moment (vaadin/react-components#283), so extracted this.
src/main/java/com/vaadin/demo/component/grid/GridItemDetailsToggle.java
Outdated
Show resolved
Hide resolved
? html` <vaadin-icon icon="lumo:angle-down"></vaadin-icon>` | ||
: html` <vaadin-icon icon="lumo:angle-right"></vaadin-icon>`} |
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.
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>
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.
Makes sense, done
Closes #3986