-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use Element.scrollIntoView
#75
Conversation
Related to [@github/auto-complete-element#91][] The current `scrollTo` helper method implementation can be unreliable (or have no effect) at times. This commit replaces it with a call to [Element.scrollIntoView][]. To control that behavior, this commit also introduces a `scrollIntoViewOptions:` key to the package's constructor call. [@github/auto-complete-element#91]: github/auto-complete-element#91 [Element.scrollIntoView]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView [ScrollIntoViewOptions]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView#sect1
f889842
to
b0dec8e
Compare
@keithamus I did a preliminary search for attempts to replace the
A quick dive into Has this been attempted in the past? |
👋 Hello and thanks for pinging us! This issue or PR has been added to our inbox and a Primer first responder will review it soon.
|
@keithamus is this something you can take on to answer or do you prefer for me to look as a FR? |
I’ll take a look thanks @broccolinisoup |
The use of Element.scrollIntoView is really helpful. I checked this and it works wonderful especially if you need to control the scroll position and behavior of it as easy as defining an option like this Thanks @seanpdoyle 👏 I would love to see this one merged @keithamus. |
I agree I just want to check some internal codebases to double check if there are any blockers before we merge. I'm a little short on time this week so I'll most likely get to this next week. |
macos build failing for some reason. I'll figure that out separately. |
- The v2.3.0 update caused to always scroll to the suggestion menu, where it previously wouldn't work at all or only scroll when it wasn't in the viewport. - Ref: github/text-expander-element#50 - Ref: github/combobox-nav#75 - Resolves https://codeberg.org/forgejo/forgejo/issues/1990 (cherry picked from commit 27145be211ff782afe0910adbe200f126961f150)
Related to @github/auto-complete-element#91
The current
scrollTo
helper method implementation can be unreliable (or have no effect) at times.This commit replaces it with a call to Element.scrollIntoView. To control that behavior, this commit also introduces a
scrollIntoViewOptions:
key to the package's constructor call.