Skip to content
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

Fix scrolling issue in Firefox #92

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Faye-yufan
Copy link
Contributor

fix #90
Deferred setting of the selector_table height to prevent unintended scrollbar behavior.

Used setTimeout with a delay of 0 ms to place the height setting operation on the JavaScript event loop, ensuring it executes after all current tasks and rendering operations are complete.

This change appears to fix an issue where the scrollbar was moving upwards when interacting with Selectize.js elements in Firefox.

@Faye-yufan Faye-yufan linked an issue Jun 3, 2023 that may be closed by this pull request
@tdhock
Copy link
Collaborator

tdhock commented Jun 14, 2023

Code looks good to me but I wonder if it is worth it to add a test case which would fail for current master, and which would pass using this branch? Or would that be too complicated? (or not super useful?)

@Faye-yufan
Copy link
Contributor Author

Faye-yufan commented Jul 25, 2023

I've just incorporated a test, though I expect it to fail, as I've rolled back the previous code change – a change that this test should fail.

About the test: Selenium doesn't provide a way to track the scrolling bar movement. So, I used a JavaScript command to capture the scroll bar's position.
I'll test it on my local as well.

selector_table
.style('height', `${selector_height}px`);
}, 0);
// setTimeout(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the fix is commented, and the tests are still passing, this seems to imply that the test is not sufficient to capture the bug, is that right? @Faye-yufan

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, this version of the test cannot capture the bug, I'm thinking of a new way to replicate the bug.

@Faye-yufan
Copy link
Contributor Author

I checked out the Selenium Firefox Docker image, and it looks like the bug isn't there in version 2.53.0. That's probably why the test passed even without the fix.

@tdhock tdhock mentioned this pull request Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Observations on a Scrolling Bug
2 participants