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
Autofocus input inside tooltip causes scroll jump #98
Comments
can you share a codesandbox depicting the issue? |
https://codesandbox.io/s/react-popper-tooltip-example-zqnxf?file=/src/index.js , I have tried to create one. If the autoFocus is removed then the tooltip is visible, if the attribute is added then it jumps to the start of the page and the onVisibilityChange is being triggered, the state value is updated so the tooltip is not seen. |
One more example where the type is set to focus and as we have the textarea element inside the tooltip, on click of the textarea within the tooltip the focus is lost and tooltip closes, the focus should close when the user clicks outside for both the focus and click trigger. |
regarding the first one, two things:
https://codesandbox.io/s/react-popper-tooltip-example-iscue |
and in the second one, there is a typo, instead of |
Yeah, so it works with array as well as with the one being tried, so I want the tooltip to get displayed on focus as well as on click of the input element present, in the tooltip I have one more textarea on click of it the tooltip closes, or we can only use the trigger as focus as it is appropriate, but on click of the tooltip to enter the value the tooltip is closed. |
that's because, with focus trigger, it simply means that tooltip shows up on focus and hides on blur. So you can't really tell the library to use click trigger in one case and focus trigger in another. You could use a custom controlled tooltip with only click trigger and show the tooltip by defining your own focus handler. |
Ok will give a try! Thank you :) |
Opening a popper-tooltip with an autofocus input inside it, causes the page to jump (scroll). How can this be resolved?
Also, as I have an input inside the tooltip, the tooltip close should be handled only on click outside the tooltip, the scroll of the main page should not cause the tooltip to close, the tooltip in opened on focus and click of the element, so as stated in #85 and #59, handling this using the the controlled component, but the onVisibilityChange method is triggered when the cursor is moved outside the tooltip area or even if it is being scrolled. How can we handle this close of the popper-tooltip only on click outside the tooltip area?
The text was updated successfully, but these errors were encountered: