Coder Social home page Coder Social logo

Comments (3)

rezrah avatar rezrah commented on May 4, 2024

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:

  1. Backfill the test coverage for useFocusZone in PRC repo (0 coverage)
  2. Backfill test coverage for focusZone.ts in this repo (currently <80% coverage)
  3. 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.

iansan5653 avatar iansan5653 commented on May 4, 2024

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.

github-actions avatar github-actions commented on May 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.