Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #3529
Closed
Open
Issue created May 18, 2012 by Administrator@rootContributor

Typeahead positioning bug with modals, scrolling and window resize

Created by: wesley-murch

The dropdown list that appears when using typeahead() doesn't stick to the input when scrolling, or when resizing the window This occurs in modals, or anytime where the parent element is fixed position.

Here's is a demo:

http://jsfiddle.net/cBLUL/

How to reproduce:

  1. Focus the input and type until the suggestion list appears
  2. While the result list is visible, scroll the page or...
  3. Resize the "Result" pane in jsfiddle

Expected result: Suggestion list does not move at all, but stays "glued" to the input.

Actual Result: The suggestion list moves around, sometimes off screen.

Here's a screen capture to demonstrate: http://www.screenr.com/CNR8

I found the scroll issue by accidentally using the mouse wheel while focused in an input with typeahead. I found the resize issue while producing a test case for the scroll issue.

It appears that the typeahead list is appended to body. This could probably be easily fixed by putting the element just after the input itself instead, or even as a last child of the parent form (or just outside the parent form) so as not to mess up any CSS or JS that relies on certain adjacent elements being in place...

On second thought, not every input will have a parent form (should, but may not in the wild), and as mentioned, putting the element in the DOM anywhere else could cause other bugs, so I'm not sure that would be a real solution.

Assignee
Assign to
Time tracking