-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
How to scroll to edit panels when opening them? #1570
Comments
editPanel.scrollIntoView is a function and you code is missing the
|
Tried that. With that code, in my case it sometimes scrolls a little tiny bit, but im not getting a proper scroll here. |
Likely because the browser already considers the element to be in view. Take a look at some of the options you can add to that call https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView You may find wraping the call in a short timeout may help if the issue is the field has not completely expanded by the time the scroll is requested, |
Setting a timeout does work, yet it has to be a timeout of around 250 ms to actually show the whole panel, which i think is too much. Is there a way to make the field expansion occur faster? |
The field slide is done here It might make sense to move emitting of the events to the slideToggle complete handler. In addition to the onOpenFieldEdit we also have $(document).trigger('fieldOpened', [{ rowWrapperID: rowWrapper.attr('id') }]) at the same point |
Description:
Hello. I have a question. Is it possible to make the window scroll to the editPanel when it is opened. I know of the onOpenFieldEdit, and have tried using it for this, trying the following with no luck:
onOpenFieldEdit: function(editPanel) { editPanel.scrollIntoView },
This code does nothing at all. And i presume it could be because of the time it takes for the editPanel to open? I have no idea.
Environment Details:
Expected Behavior
I would expect the scrollIntoView method to make the editPanel be in view.
Actual Behavior
Nothing
Steps to Reproduce
onOpenFieldEdit: function(editPanel) { editPanel.scrollIntoView },
The text was updated successfully, but these errors were encountered: