-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(description-list): Adding option and logic to hide/show items in lists - FRONT-3895 #2821
feat(description-list): Adding option and logic to hide/show items in lists - FRONT-3895 #2821
Conversation
… lists - FRONT-3895
…brary into FRONT-3895-Description-list-visible-items
this.lists.forEach((list) => { | ||
if (list.children && list.children.length > this.visibleItems) { | ||
this.showHide(list.children); | ||
const button = document.createElement('a'); |
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.
wouldn't it be better to use a real button instead of a link (without href)?
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 changed this in the last commit, it is because of the styles that the buttons have, that were a bit problematic and would sure requiremore iterations on the design side to tweak it.
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.
Ok, to be seen if that doesn't raise accessibility issues later (having a link without href is usually a bad practice)
Also the css has to be updated in this case, to have the hand cursor on hover (it isn't added if there is no href)
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 added the href.. ;) a link is still valid without an href but without it we would not be able to make the keyboard navigation work as expected without additional coding, so i simply added it
src/implementations/twig/components/description-list/description-list.html.twig
Show resolved
Hide resolved
src/implementations/twig/components/description-list/description-list.html.twig
Outdated
Show resolved
Hide resolved
src/implementations/twig/components/description-list/description-list.html.twig
Outdated
Show resolved
Hide resolved
…on-list.html.twig Co-authored-by: Romain Emery <emery.romain@gmail.com>
…on-list.html.twig Co-authored-by: Romain Emery <emery.romain@gmail.com>
…m:ec-europa/europa-component-library into FRONT-3895-Description-list-visible-items
thanks @emeryro, the focusable area should be ok now |
…m:ec-europa/europa-component-library into FRONT-3895-Description-list-visible-items
as requested standaone links, inline links, taxonomy list items can be limited by setting a common parameter when including the template.
.
A control has been added in the story as a range, by default the vertical example is having collapsed lists while the horizontal doesn't.