-
Notifications
You must be signed in to change notification settings - Fork 223
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
sui-search: Autocomplete doesn't show up as the user types from empty search field #357
Comments
I am experiencing the same behavior |
I also have the same problem Angular: 5.2.4 |
I'm also experiencing this issue. Angular : 6.0.1 |
I'm also experiencing this issue. |
fix Array declerations syntax fix strange bug on build (edcarroll#357) fix optional param
Are there any work arounds until the fix is accepted ? |
@turgodi manually remove the problematic return from the bundle / use my branch |
3 month later and this fix is still not approved... |
My workaround for now is to call setOpenState specifically when the search occurs. <sui-search #searchBox ...> @ViewChild("searchBox") searchBox; optionsLookup(s, n): Promise<NameIdPair[]> { |
@turgodi my branch is not published as an npm package. You need to clone the branch to your machine, build the code locally and then include the output in your project. |
I ended up using @earbullet workaround. Thank you for the help @eyalhakim. :) |
fix Array declerations syntax fix strange bug on build (edcarroll#357) fix optional param
An add-on to @earbullet's solution. So I had to add a component.html <sui-search #searchBox (keyup)="keyupHandler()"> component.ts keyupHandler(): void {
setTimeout(() => {
let isOpen: boolean = this.searchBox.query != "";
this.searchBox.dropdownService.setOpenState(isOpen);
}, 200);
// the 200 is the default search delay, so the dropdown still syncs with the search result.
} Admittedly a bit hacky, but it's already hacky setting dropdown open state directly. |
Bug description:
I'm seeing an issue with the search component where the autocomplete doesn't show up when the user starts typing into an empty search box. It only shows up after there is already text in the box and the user clicks the search field. I think this got broken in the latest build (0.9.7). I took a look at the compiled script in the debug tools and I'm seeing this:
That return looks like it's not supposed to be there. It doesn't even exist in the TS file https://github.com/edcarroll/ng2-semantic-ui/blob/master/src/modules/search/components/search.ts#L100 .
Link to minimally-working plunker that reproduces the issue:
Hijacking this plnkr from another issue since it displays the same problem as well:
http://plnkr.co/edit/RpMQDS6spIsWXNcMG5JD?p=preview
Version of Angular, ng2-semantic-ui, and Semantic UI:
Angular: 5.2.9
ng2-semantic-ui: 0.9.7
Semantic UI: 2.3.0
The text was updated successfully, but these errors were encountered: