Closed dkilgore-eightfold closed 6 months ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit a975b2ab4185954107386358d3ceb14f95aae31d:
Sandbox | Source |
---|---|
React | Configuration |
Attention: 40 lines
in your changes are missing coverage. Please review.
Comparison is base (
3791c41
) 85.06% compared to head (a975b2a
) 85.17%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
SUMMARY:
This change adds
ArrowDown
,ArrowLeft
,ArrowRight
, andArrowUp
keyboard navigation support to address existing usability bugs inList
,Dropdown
,Menu
,CascadingMenu
, andSelect
components.SELECTOR
string fromuseFocusTrap
scope to utility scope so that it may be used byList
focusable
function that returns true if certain attributes exist on element passed into it via argsList
component via its newhandleItemKeyDown
functionList
getItem
prop implementation to be wrapped inexternalItem
so that we can access its propertiesList
getAdditionalItem
such that it may be included in the focus loopList
to include an option to disable default arrow key handling viadisableArrowKeys
propDropdown
to supportArrowDown
andArrowUp
keys via itshandleReferenceKeyDown
to open and close theDropdown
, when theDropdown
is open we place focus on the first focusable selector, when closed we place focus back on the reference elementDropdown
story demonstratingadditionalItem
andrenderAdditionalItem
initialFocus
andreferenceOnKeydown
props toDropdown
focusFirstElement
andfocusOnElement
helpers toDropdownRef
DropdownRef
viaoctuple.ts
to assist with strict type implementationsSelect
to place focus back on its reference element when itsDropdown
is closedSelect
to includeinitialFocus
prop to enable granular control of how itsDropdown
steals focusMenuItemButton
,MenuItemCustom
,MenuItemLink
,MenuItemSubHeader
, andMenuItem
componentsMenuItemSubHeader
to work with keyboard navigation, preserves current behaviorMenuProps
, markingsubHeader
as deprecated because its not usedfloating-ui
useListNavigation
support toCascadingMenu
as its supported there by its canonicalfloating-ui
implementationButton
implementations to usevariant
prophttps://github.com/EightfoldAI/octuple/assets/99700808/55067a16-a82a-4cd5-af1f-f60bf8014bc7
GITHUB ISSUE (Open Source Contributors)
https://github.com/EightfoldAI/octuple/issues/757
JIRA TASK (Eightfold Employees Only):
ENG-72532 ENG-72534 ENG-72536
CHANGE TYPE:
TEST COVERAGE:
TEST PLAN:
Pull the PR branch and
yarn
and thenyarn storybook
. Verify theList
,Dropdown
,Menu
, andSelect
stories behave as expected.