Repository navigation
Fix tabbing between fields not working with mixed_text field - #1685
rute-santos wants to merge 3 commits into
Conversation
…tyle for disabled 'Next' button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This pull request is deployed at test.admin-interface.opencast.org/1685/2026-10-09_16-43-20/ . |
|
Use Run test server using develop.opencast.org as backend: Specify a different backend like stable.opencast.org: It may take a few seconds for the interface to spin up. |
I am against this part. Having important control elements be inaccessible to keyboard controls hurts accessibility. And the proposed alternative is hardly adequate. It seems very unintuitive and poses usability concerns (Want to delete the first element in the list? Welp, you'll have to delete all other elements first). |
Make multi-value remove buttons keyboard accessible again Change handler name Remove unrelated css change Simplified focus handling (Claude says still needed for focus-trap 8.2.2) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi @Arnei I believe I/Claude addressed all your comments. Thanks! |
| return () => handleBlur(textRef.current); | ||
| return () => { | ||
| clearTimeout(leaveTimeout.current); | ||
| handleBlur(textRef.current); |
There was a problem hiding this comment.
I wonder if it would simplify the code if we were to combine handleBlur and handleFocusLeaveField into one function? The former is called when the component unmounts, while the latter is called onBlur which coincidentally also results in the component unmounting. So we have two methods doing very similar things at very similar timings here.
There was a problem hiding this comment.
I (i.e. Claude) made all the requested changes. I hope it's ok now!
There was a problem hiding this comment.
I wonder if it would simplify the code if we were to combine handleBlur and handleFocusLeaveField into one function?
This was not addressed as far as I can tell. Does not necessarily mean there has to be a code-change, an explanatory comment here would be fine too.
Fix keyboard navigation through
mixed_textmetadata fields; style disabled wizard buttonsProblem
In the wizards (e.g. "Add event"), multi-value
mixed_textfields such asPresenter(s) or Contributor(s) broke keyboard navigation:
held only in local state. The value was never committed, so required fields
stayed invalid and the Next button stayed disabled with no visible
reason. This was visible when the next field was also editable.
nowhere.
RenderMultiFieldinstances shared one module-levelchildRef, so theclick-outside detection was attached to whichever field rendered last.
Changes
RenderMultiField.tsxchildRefis now created per component withuseRef. It is passed toEditMultiSelectascontainerRef.onBluron the field container checksrelatedTarget. When focusmoves outside the field, the typed value is committed and the field leaves
edit mode. Clicks are still handled by
useClickOutsideField.while the browser is still moving focus to the next field. With
focus-trap ≥ 8.2, removing it earlier makes the modal's focus trap pull
focus back to the close button at the top of the modal, skipping the
remaining fields. The unmount cleanup cancels a pending leave, so a value
isn't committed twice.
submitValueis called through a ref, so callers that run outside thecurrent render (the unmount cleanup) use the latest field value. Before,
they could overwrite values added in the meantime.
focus moves back to the input instead of being lost.
How to test
Tab until focus leaves the field. Focus should move through the "x"
buttons and then to the next field, not to the top of the modal. The name
should become a label and the field should close.
multi-value field should be reached in order.
The value should be removed and focus should go back to the input.
should move to the previous field.
Click outside it. It should close and keep the typed value.
AI Usage
🤖 Generated with Claude Code