Closed narehart closed 3 years ago
I should be wired to ScrollLock
as well, or it will suppress events from "outer" nodes.
And right now it does not support such prop.
Would it be required to solve your case?
Not required in my case because there is no scrolling on the dropdowns being rendered. But I could see it being a problem.
Ok. Let's solve one problem a time.
I am also going to rename this prop as long as it's actually about ignore
, however it will also require to "flip" the meaning of result
Like shouldIgnore?: (activeElement: HTMLElement) => boolean;
-> true is "ignore", "false" is handle.
- <FocusOn whiteList={node => document.getElementById('root').contains(node)}>
+ <FocusOn shouldIgnore={node => !document.getElementById('root').contains(node)}>
Nowadays usually there are 2 props (in different tools, like Jest for example):
includePattern
- always required. And this is what old whiteList
is.excludePattern
or ignorePattern
. And this is what new shouldIgnore
might beWhich way sounds better for you?
I agree shouldIgnore
makes more sense
BTW, this alternate name isn't documented -- I was trying to use whiteList. And does it actually "flip" the value? Looks like it just passes it on, from what I can tell.
Exposes
whiteList
prop fromreact-focus-on
for cases where ref shards cannot be used, e.g., another library that renders a dropdown into the body.