Skip to content
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

front: fix combobox behavior #10168

Closed
wants to merge 1 commit into from
Closed

Conversation

Uriel-Sautron
Copy link
Contributor

close #8932

  - when clicked in the combox scroll bar, the focus shifted to the view's main div

Co-authored-by: nncluzu <[email protected]>
Signed-off-by: Uriel-Sautron <[email protected]>
@Uriel-Sautron Uriel-Sautron requested a review from a team as a code owner December 23, 2024 13:10
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Dec 23, 2024
@@ -181,7 +181,8 @@ const StdcmView = () => {
if (error && error.message !== NO_CONFIG_FOUND_MSG) throw error;

return (
<div role="button" tabIndex={0} className="stdcm" onClick={() => setShowStatusBanner(false)}>
Copy link
Member

Choose a reason for hiding this comment

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

Removing this has accessibility consequences: it's no longer possible to activate the button via the keyboard.

Copy link
Member

Choose a reason for hiding this comment

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

Hm, but it's not really a button since it wraps the whole STDCM view… I think we should drop role="button" as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interacting with this div just removes the simulation banner. Do we need to activate it on the keyboard?

Copy link
Member

@emersion emersion Dec 23, 2024

Choose a reason for hiding this comment

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

The container doesn't act like a button, so I don't think role="button" is appropriate here.

There are many ways to "interact" with a form, using the mouse to do so is just one of them. For instance, the Tab key focuses the next form element, or the "Next" key on an on-screen keyboard (e.g. on an Android tablet) has the same effect.

Maybe onFocus is what we want here instead of onClick?

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.95%. Comparing base (7096406) to head (d89abaa).
Report is 141 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10168      +/-   ##
==========================================
- Coverage   79.96%   79.95%   -0.01%     
==========================================
  Files        1057     1057              
  Lines      106335   106336       +1     
  Branches      724      724              
==========================================
- Hits        85028    85024       -4     
- Misses      21265    21270       +5     
  Partials       42       42              
Flag Coverage Δ
editoast 73.96% <ø> (-0.02%) ⬇️
front 89.20% <100.00%> (+<0.01%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 87.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@clarani
Copy link
Contributor

clarani commented Jan 9, 2025

Not relevant anymore, since the bug was solved by #10293

@clarani clarani closed this Jan 9, 2025
@clarani clarani deleted the usn/fix-combobox-behavior branch January 9, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

STDCM: The mouse scroll for the combo box field isn't working
4 participants