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

Typeahead box alignment issues #1396

Closed
hassanasad opened this issue Dec 24, 2016 · 18 comments
Closed

Typeahead box alignment issues #1396

hassanasad opened this issue Dec 24, 2016 · 18 comments
Assignees

Comments

@hassanasad
Copy link

Hi - Typeahead was working perfectly in previous version, however i believe in one of the recent updates the alignment of the box that shows suggestions are messing up. The box now shows up after the input field and not below it.

Also i am not sure how to debug its CSS values as it closes as soon as i click anywhere inside my chrome inspector :)

Just for reference here is a screenshot: https://www.dropbox.com/s/zqxr1lzjc76zhy9/Screenshot%202016-12-24%2012.56.16.png?dl=0

@zkorz
Copy link

zkorz commented Dec 25, 2016

Same thing happening to me when updating:
image

@valorkin
Copy link
Member

@zkorz @hassanasad are you using hybrid app too?

@valorkin valorkin self-assigned this Dec 26, 2016
@hassanasad
Copy link
Author

@valorkin - I am not sure what hybrid apps are. I am just using your package with Angular2 (2.4 to be exact) and angular-cli.

@olaf89
Copy link

olaf89 commented Dec 26, 2016

I had same problem, i used .form-inline, after updating to latest version dropdown was aligned as showed on screenshots. Its not specific to hybrid apps.

@valorkin
Copy link
Member

Can you give me peace of html with Typeahead
So I can reproduce it

@olaf89
Copy link

olaf89 commented Dec 26, 2016

Sure,

<div class="form-inline">
    <div class="form-group">
        <label>label</label>
        <input type="text" id="input" class="form-control" [(ngModel)]="selected" [typeahead]="items">
    </div> 
</div>

@zkorz
Copy link

zkorz commented Dec 26, 2016

Mine works when I take away the class navbar-form from the parent span.

<span class="navbar-form" role="search">
    <form class="btn-group ng-valid ng-touched ng-dirty">
        <input class="form-control ng-valid ng-touched ng-dirty" name="search" placeholder="Search students or assignments..." type="search">
        <span class="glyphicon glyphicon-remove-circle searchclear"></span>
    </form>
</span>

@hassanasad
Copy link
Author

Well looking at the mark up of other folks here, i believe its some issue that appears with bootstrap ? (I too am using it with bootstrap) - however it was working fine before the recent updates.

@valorkin
Copy link
Member

Before, I was forcing position of container and internal elemement, now only container.
One way or another I will publish a fix today

@hassanasad
Copy link
Author

hassanasad commented Dec 27, 2016

Thanks @valorkin and happy holidays ;)

@valorkin
Copy link
Member

@hassanasad thanks, you too ;)

@valorkin
Copy link
Member

ok, issues was with form inline
so I fixed it and now you can use container="body" to attach typeahead to body ;)

@valorkin
Copy link
Member

published as 1.1.16-10, please try and drop me a note

@hassanasad
Copy link
Author

Works perfectly for me again!

Thanks @valorkin :)

@zkorz
Copy link

zkorz commented Dec 27, 2016

@valorkin the main form is working great now:

image

However on the extra small screen the typeahead is only showing the first choice, maybe sensing that there is not a lot of room below even though there really is beneath the navbar.

image

Here is the simplified markup:

<nav class="navbar navbar-default" role="navigation" style="">
    <div class="collapse navbar-collapse" aria-expanded="true" aria-hidden="false" style="display: block; overflow: visible; height: auto;">       
        <ul class="nav navbar-nav" id="navbarSearchBox">
            <li>
                <div class="col-xs-12">
                    <span class="navbar-form" role="search">
                        <form class="btn-group">
                            <input class="form-control" name="search" type="search">
                        </form>
                    </span>
                </div>
            </li>
        </ul>
    </div>
</nav>

@valorkin
Copy link
Member

@zkorz can you try container="body" ?

@zkorz
Copy link

zkorz commented Dec 27, 2016

@valorkin that was it. works perfectly now.

@aleksander351
Copy link

aleksander351 commented Nov 11, 2021

@valorkin is there any way to align the dropdown to the right?
Otherwise it overflows the page if the list items are very long.
I borrowed the image from @zkorz
I see that the typeahead directive has a protected placement property.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants