Comments (3)
Hi @iansan5653 - thanks for filing this bug report. We're going to take a closer look at this in the Primer React team over the next week, but unfortunately I can't commit to a resolution date just yet.
At this time, we don't have high confidence that a fix will not create downstream regressions in Primer React. This is because useFocusZone
, which many components in Primer React rely on does not have adequate test coverage. To avoid these risks, we want to be a bit more cautious with this update.
Our plan is currently:
- Backfill the test coverage for
useFocusZone
in PRC repo (0 coverage) - Backfill test coverage for
focusZone.ts
in this repo (currently <80% coverage) - Investigate / remediate reported bug
We're being extra cautious as we've recently seen various ad-hoc bugfixes ship, that created regressions in their dependencies and required rollback.
Did you already have a solution in mind for point 3? If so, please feel free to put a PR up for it, or we can take a look at it once we've resolved the first two points.
from behaviors.
Did you already have a solution in mind for point 3?
I do, but it is opinionated - I don't know if your team will want to go in the same direction.
In my opinion the best solution would be to just forward the behavior by passing null
to the callback. This would require a breaking change to the types though - the type of focusInStrategy
would have to change to add null
to the function arg type:
- focusInStrategy?: 'first' | 'closest' | 'previous' | ((previousFocusedElement: Element) => HTMLElement | undefined)
+ focusInStrategy?: 'first' | 'closest' | 'previous' | ((previousFocusedElement: Element | null) => HTMLElement | undefined)
Anywhere consuming code is providing a function they'll have to handle the null
case. I think this would be a pretty safe change from a testing perspective on this end since we'd just be forwarding the behavior downstream.
from behaviors.
Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.
from behaviors.
Related Issues (15)
- Focus Zone sets tabIndex to 0 for unfocusable element when it updates HOT 4
- Focus zone calls error in vitest + jsdom HOT 2
- Set up Storybook HOT 1
- Update Node version on GitHub actions HOT 3
- Add support for contenteditable=true in iterateFocusableElements HOT 2
- Test issue
- `getAnchoredPosition` does not respect `margin` on document body HOT 5
- Focus Zone, moving focus stops working upwards if hidden attribute is set to true of an element in the focus flow HOT 4
- Focus Zone, ArrowVertical does not take into account input elements that have step defined HOT 9
- Set up Changesets HOT 1
- Set up Doctocat HOT 1
- Replace behaviors in PRC HOT 2
- `getAnchoredPosition` returns position without perfectly aligned edges HOT 3
- Bug: when ancestor element is a wrapping `span`, `getAnchoredPosition` returns odd floating element position HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from behaviors.