stable

Clone or download

Read-only

fix: Put back keyboard arrow navigation in lazybox dropdown

How to test: In lazybox instances (tlp-doc, artifact link field in the modal, reviewers in pullrequest overview), you can change the focus of the dropdown items with the arrow up ↑ / down ↓ keys. If you reach the beginning or the end, it cycles back to the other end. Notes: In git #tuleap/stable/8b6e472d2210cda91506b088700e6bcbf2a80f8e, keyboard arrow navigation was removed from lazybox (it was already a big patch). This brings it back. The cycling behaviour is moved to a dedicated library in the hope it will be reused: it could be applied to swimlane navigation in taskboard, for example. The "new item" button is also part of the navigation, but the search input is excluded from it to avoid messing up the query. It is still possible to go back to the search by navigating to the top element and pressing shift+tab. The editor examples now have more than one group of items to demonstrate that the keyboard navigation "jumps" from one group to the next. part of request #31583 Lazybox big clean-up Change-Id: I20d576ae7a0fe912b397020504f200ac5fb2cc9c

Modified Files

Name
A lib/frontend/focus-navigation/.gitignore +1 −0 Go to diff View file
A lib/frontend/focus-navigation/README.md +5 −0 Go to diff View file
A lib/frontend/focus-navigation/package.json +27 −0 Go to diff View file
A lib/frontend/focus-navigation/pnpm-lock.yaml +9 −0 Go to diff View file
A lib/frontend/focus-navigation/src/focus.test.ts +130 −0 Go to diff View file
A lib/frontend/focus-navigation/src/focus.ts +80 −0 Go to diff View file
A lib/frontend/focus-navigation/src/main.ts +20 −0 Go to diff View file
A lib/frontend/focus-navigation/tsconfig.json +7 −0 Go to diff View file
A lib/frontend/focus-navigation/vite.config.ts +31 −0 Go to diff View file
M lib/frontend/lazybox/package.json +2 −1 Go to diff View file
M lib/frontend/lazybox/pnpm-lock.yaml +3 −1 Go to diff View file
M lib/frontend/lazybox/src/dropdown/DropdownElement.test.ts +43 −0 Go to diff View file
M lib/frontend/lazybox/src/dropdown/DropdownElement.ts +23 −0 Go to diff View file
M lib/frontend/lazybox/src/dropdown/GroupTemplate.test.ts +42 −3 Go to diff View file
M lib/frontend/lazybox/src/dropdown/GroupTemplate.ts +27 −27 Go to diff View file
M lib/frontend/lazybox/src/dropdown/__snapshots__/GroupTemplate.test.ts.snap +29 −24 Go to diff View file
M lib/frontend/lazybox/vite.config.ts +1 −0 Go to diff View file
M src/scripts/tlp-doc/src/editors.js +58 −37 Go to diff View file