Skip to content

Conversation

@Ovgodd
Copy link
Collaborator

@Ovgodd Ovgodd commented Dec 17, 2025

Purpose

Improve keyboard accessibility when opening the emoji picker
by focusing the input field automatically. Also fix keyboard interaction with
subdocuments using the Enter key.

Proposal

Automatically place focus on the search input when the emoji picker opens.
Additionally, ensure that pressing Enter correctly selects subdocuments,
improving keyboard usability.

  • Focus emoji picker input on open
  • Fix Enter key handling on subdocuments

ensures subdoc opens and emoji picker focus on input

Signed-off-by: Cyril <c.gromoff@gmail.com>
@Ovgodd Ovgodd requested a review from AntoLC December 17, 2025 13:58
@Ovgodd Ovgodd self-assigned this Dec 17, 2025
ensures subdoc opens and emoji picker focus on input

Signed-off-by: Cyril <c.gromoff@gmail.com>
@Ovgodd Ovgodd force-pushed the fix/a11y-emoji-picker-focus-and-enter branch from 70177ca to 7c90e7f Compare December 17, 2025 13:59
@Ovgodd Ovgodd marked this pull request as ready for review December 17, 2025 13:59
@github-actions
Copy link

github-actions bot commented Dec 17, 2025

Size Change: +303 B (+0.01%)

Total Size: 4.15 MB

Filename Size Change
apps/impress/out/_next/static/cfd758b2/_buildManifest.js 0 B -885 B (removed) 🏆
apps/impress/out/_next/static/e2de4978/_buildManifest.js 886 B +886 B (new file) 🆕

compressed-size-action

- 🌐(backend) internationalize demo #1644
- ♿(frontend) improve accessibility:
- ♿️Improve keyboard accessibility for the document tree #1681
- ♿️(frontend) fix subdoc opening and emoji pick focus #1745
Copy link
Collaborator

Choose a reason for hiding this comment

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

When rebase with main it will have to go under Unreleased.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you delete this part so, as it is doing the same action ?

onKeyDown={(e) => {
if (e.key === 'Escape' && openEmojiPicker) {
setOpenEmojiPicker(false);
}

}, [onClickOutside]);

const pickerContent = (
<Box $position="absolute" $zIndex={1000} $margin="2rem 0 0 0">
Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer to avoid useEffect when possible, can we add the keydown action on the Box prop ?

Comment on lines +27 to +28
e.preventDefault();
e.stopPropagation();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it really necessary to stop the bubbling or the default behavior ?

Comment on lines +113 to +120
useKeyboardActivation(
['Enter'],
isActive && !menuOpen,
handleActivate,
true,
'.c__tree-view',
);

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you need it anymore, this commit (suitenumerique/ui-kit@c121fdd#diff-69b4765cf5a180b5d5c2157eb0132487a6c0b7b7fb1dc379250ce110ac162e2eR27) adds onKeyDown, so here you can add directly what you need now.
You have to bump to the last ui-kit version though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants