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: fix dropdown menu position with scroll #1199

Merged
merged 3 commits into from
Mar 31, 2022

Conversation

ArthurTriis1
Copy link
Contributor

@ArthurTriis1 ArthurTriis1 commented Mar 29, 2022

Signed-off-by: Arthur Andrade arthurfelandrade@gmail.com

What's the purpose of this pull request?

This PR fix bugs with scroll on Dropdown component. It adds the properties scrollLeft and scrollTop to calculate of position, and adds event.preventDefault() in KeyDown press event, avoiding page scroll when pressed.

References

https://stackoverflow.com/a/18673641

@ArthurTriis1 ArthurTriis1 requested a review from a team as a code owner March 29, 2022 20:13
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 29, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 511453e:

Sandbox Source
Store UI Typescript Configuration

@ArthurTriis1 ArthurTriis1 force-pushed the fix/fix-dropdown-position-with-scroll-bug branch from ea218d7 to 6d738de Compare March 29, 2022 20:29
@hellofanny hellofanny changed the title fix: fix dropdown menu position with scroll fix: dropdown menu position with scroll Mar 30, 2022
@hellofanny hellofanny changed the title fix: dropdown menu position with scroll fix: fix dropdown menu position with scroll Mar 30, 2022
Copy link
Contributor

@heitorado heitorado left a comment

Choose a reason for hiding this comment

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

LGTM, left some questions for discussion

Copy link
Contributor

@igorbrasileiro igorbrasileiro left a comment

Choose a reason for hiding this comment

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

Add tests for this fix.

Copy link
Contributor

@heitorado heitorado left a comment

Choose a reason for hiding this comment

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

Well done :)

@ArthurTriis1 ArthurTriis1 force-pushed the fix/fix-dropdown-position-with-scroll-bug branch from 5f03a15 to 8f4729a Compare March 30, 2022 19:42
Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
@ArthurTriis1 ArthurTriis1 force-pushed the fix/fix-dropdown-position-with-scroll-bug branch from 8f4729a to 511453e Compare March 31, 2022 17:50
@ArthurTriis1 ArthurTriis1 merged commit 98a228e into master Mar 31, 2022
@ArthurTriis1 ArthurTriis1 deleted the fix/fix-dropdown-position-with-scroll-bug branch March 31, 2022 17:56
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.

3 participants