question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Choices dropdown appears outside the viewport

See original GitHub issue

Hi there!

I’m using Choices.js 7.0.0 in my project and there seems to be an issue with the dropdown positioning. Whenever the browser viewport’s height is low, I’d expect the dropdown to appear with the “top” position but it just opens to the bottom, as always, and gets hidden behind the browser viewport:

Screen Capture on 2019-11-13 at 10-44-36

I use a very basic configuration:

searchEnabled: false, shouldSort: false, itemSelectText: '',

And that’s it. I’ve also removed my custom styling for choices.js for a moment but did not help.

Thanks!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tinovyatkincommented, Nov 15, 2019

It certainly doesn’t. But in this viewport size, the whole dropdown doesn’t fit neither top nor bottom part. So, we either need to implement some heuristic behavior to have a preference or leave it as is. What will be your suggestion? To calculate in which position the dropdown will have a higher visibility percentage? For small viewports (i.e. mobile) native browsers implements over-viewport UX we have no way to implement in a custom control.

0reactions
filip-jkcommented, Nov 14, 2019

I strongly believe that the case I uploaded the screenshot of is really “ugly”. We can clearly see there is more space to the bottom of the input and that’s where the dropdown should go so the “calculate in which position the dropdown will have a higher visibility percentage” is a great idea.

Another improvement is a new option that could be used to set a certain amount of “space” for the dropdown (either a fixed amount like 200px or a percentage of the dropdown height) and once there is less than that, the native browser select could be shown instead. It would be optional, of course.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Choices dropdown appears outside the viewport #752 - GitHub
Hi there! I'm using Choices.js 7.0.0 in my project and there seems to be an issue with the dropdown positioning.
Read more >
Select Dropdown going out of screen in mobile view
When you view the browser's moblie mode, there is a mechanism that clearly shows your selection and drop-down menu. These sections look ...
Read more >
Dropdowns - Bootstrap
Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap dropdown ...
Read more >
Make dropdown show up properly outside of .container ...
Set container's <code>overflow</code> to <code>visible</code>. The problem is that it breaks the scroll bar. 5. </p>. 6. <div class="container">.
Read more >
Solution For Very Long Dropdown Menus - CSS-Tricks
The problem with long dropdowns is that the dropdown itself can go below the “fold” of the website. That is, below the visible...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found