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

Picker appears off-screen #10

Open
jarretttaylor opened this issue May 20, 2020 · 0 comments
Open

Picker appears off-screen #10

jarretttaylor opened this issue May 20, 2020 · 0 comments

Comments

@jarretttaylor
Copy link

There is a change in dist/bootstrap4-clockpicker.js around line 574 that doesn't appear in src/clockpicker.js. This change was introduced in this commit. The presence of a change in a distribution file and not in a source file is cause enough for concern, but the purpose of this issue is to report that the change introduced a bug (that it is was likely trying to fix).

The referenced change can cause the picker to display off-screen if the input triggering the picker is significantly lower in the document.

Scenario:

  • Document height: 2000px
  • Window height: 700px
  • popoverHeight height: approximately 330px
  • Input element location (top): approximately 1700
  • User scrolls down the page/document to access the input element.
  • User click the input element triggering the picker to show.

In the referenced code, the following calculation and manipulation is applied:

if (popoverHeight + styles.top > windowHeight) {
	styles.top = windowHeight - popoverHeight;
}

That results in the picker appearing somewhere around 370px from the top of the document (not the window) which results in it not appearing within view.

Presumably, a similar issue exists with the "width" check also included in that commit.

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

No branches or pull requests

1 participant