-
Notifications
You must be signed in to change notification settings - Fork 66
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
Manually provide Ref #85
Comments
Shards and “the main node” are not equal - without the main one being explicitly set nothing would work.
|
It seems to be working this way! const ResizableWithRef = forwardRef((props, ref) =>
<Resizable {...props} ref={i => i && ref(i.resizable)}/>
);
<FocusLock className={modalClass} autoFocus={autoFocus}
as={ResizableWithRef}
lockProps={{
minWidth: 400,
minHeight: 200,
defaultSize: {width: 'auto', height: 'auto'},
}}>
{children}
</FocusLock> But I wish there was another one to avoid extra wrappers, like manually passing dom element to FocusLock |
Like |
Hey! Look like the next version is going to break this fix - |
You mean next version of re-resizable or focus-lock? |
of focus-lock. But I would provide a helper function to handle |
@klimashkin - your case got documented as a use case for import {useTransformRef} from 'use-callback-ref';
const ResizableWithRef = forwardRef((props, ref) =>
<Resizable {...props} ref={useTransformRef(ref, i => i ? i.resizable : null)}/>
); I am moving forward with #88, please update your transformer function as long as |
Since there is a workaround probably that is ok to close this issue |
Hi! I'm trying to to use
react-focus-lock
with re-resizable and produce only one final div.But
re-resizable
doesn't have ref forwarding, but providesresizable
prop in its own instance that points to the final div.I was trying to take this div, put into own artificial
this.ref
object and feed it toshards
, like that:But it seems to be not working. Is there any other approach that might help?
The text was updated successfully, but these errors were encountered: