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

feat(ui5-slider): focus and keyboard handling implementation #2614

Merged
merged 16 commits into from
Jan 11, 2021

Conversation

ndeshev
Copy link
Contributor

@ndeshev ndeshev commented Dec 22, 2020

The Slider is now focusable, the element that gets the focus when
the component is active is the slider's handle. A new private property
'focused' is added.

The full keyboard handling specifications are implemented:

  • [TAB] Forward navigation
    -- On entering, move focus to the Slider.
    -- If focus is on the Slider, move focus to the next element within the tab chain after the Slider.

  • [SHIFT] + [TAB] Backward navigation
    -- On entering, move focus to the Slider.
    -- If focus is on the Slider, move focus to the previous element within the tab chain before the Slider.

  • [RIGHT], [UP], or [+] Increases the value of the Slider by a small increment.
    -- The Slider Thumb moves to the right/ up by the according value.
    -- If the Slider Handle (Thumb) is at the maximum value position, do nothing.

  • [LEFT], [DOWN], or [-] Decreases the value of the Slider by a small increment
    -- The Slider Thumb moves to the left/ down by the according value.
    -- If the Slider Thumb is at the minimum value position, do nothing.

  • [CTRL]+[RIGHT], [CTRL]+[UP], or [PAGE UP] Increases the value of the Slider by a large increment
    -- The Slider Thumb moves to the right/ up accordingly.
    -- If the Slider Thumb is at the maximum value position, do nothing.

  • [CTRL]+[LEFT], [CTRL]+[DOWN], or [PAGE DOWN] Decreases the value of the Slider by a large increment.
    -- The Slider Thumb moves to the left/ down accordingly.
    -- If the Slider Thumb is at the minimum value position, do nothing.


  • [HOME] Sets the minimum value. The Slider Thumb moves to the leftmost/ bottommost position.
  • [END] Sets the maximum value. The Slider Thumb moves to the rightmost/ topmost position.
  • [ESC] Sets the Slider back to the value which it had when it got the focus.

The Slider is now focusable, the element that gets the focus when
the component is active is the slider's handle. A new private property
'focused' is added.

The full keyboard handling specifications are implemented.
@ndeshev ndeshev changed the title feat(ui5-table): focus and keyboard handling implementation feat(ui5-slider): focus and keyboard handling implementation Dec 22, 2020
@ndeshev ndeshev force-pushed the slider-focus-and-kbd-handling branch from 53785a9 to a07f2f6 Compare December 29, 2020 05:48
@ndeshev ndeshev marked this pull request as ready for review December 29, 2020 14:27
packages/main/src/RangeSlider.js Show resolved Hide resolved
packages/main/src/Slider.js Outdated Show resolved Hide resolved
packages/main/src/Slider.js Outdated Show resolved Hide resolved
@d3xter666
Copy link
Contributor

Reseting with ESC doesn't relly work well.
When you go with the keyboard and make some changes, then hit ESC, it won't reset the value in some cases. However, when you navigate with the arrows it gets reset.

@d3xter666
Copy link
Contributor

HOME & END don't work as expected.

Focus the handle, navigate several times with just the arrow.
Now try with HOME & END one of them works, but the other not.

@d3xter666
Copy link
Contributor

The inactive slider works with HOME & END

@ndeshev
Copy link
Contributor Author

ndeshev commented Jan 9, 2021

I fixed the problem that the inactive Slider (with step set to '0') is affected by the keyboard shortcuts, but cannot reproduce the the first two described issues with ESC, HOME and END keys.

-- onEnterDom() moved from Slider.js to SliderBase.js
-- The Slider's handle is now focused via UI5Element getFocusDomRef()
-- The private 'focus' property is removed as it is no longer used
-- Keyboard interactions with inactive Slider (with step 0) are prevented
@MapTo0 MapTo0 merged commit 7b78c16 into SAP:master Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants