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

Your demo Bootstrap 3 latest version doesn't work #89

Open
sn3f opened this issue Sep 21, 2020 · 13 comments · May be fixed by #129
Open

Your demo Bootstrap 3 latest version doesn't work #89

sn3f opened this issue Sep 21, 2020 · 13 comments · May be fixed by #129
Assignees

Comments

@sn3f
Copy link

sn3f commented Sep 21, 2020

Describe the bug
The Bootstrap 3 demo page doesn't work. Only the Bootstrap 4 demo page work. JSON file is loaded but nothing are displayed ! I get the same issue on my test environment.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://raw.githack.com/xcash/bootstrap-autocomplete/master/dist/latest/indexV3.html
  2. Type 3 charterers
  3. Nothing appear

Expected behavior
Suggestions appear..

Desktop (please complete the following information):

  • Browser: Chrome Version 85.0.4183.102, Firefox Version 68.12.0esr (32-bit) and IE 11
@xcash xcash self-assigned this Sep 28, 2020
@xcash xcash added the bug label Sep 28, 2020
@Ahmed-Aboud
Copy link

works fine with
https://cdn.jsdelivr.net/gh/xcash/[email protected]/dist/latest/bootstrap-autocomplete.min.js

@Ahmed-Aboud
Copy link

@xcash also these links redirect to localhost:9000

image

@xcash
Copy link
Owner

xcash commented Oct 7, 2020

@Ahmed-Aboud those links are for the development environment (as stated above in the README)

@TimmFitschen
Copy link

I had the same issue after updating from 2.3.0 to 2.3.7. I downgraded to 2.3.5 and it worked.

I have the impression that a this.show() is missing somewhere around here:

liList.push(li);

@mbrodala
Copy link

mbrodala commented Nov 9, 2020

The problem is that the .dropdown-menu class is used for autocomplete icons. In Bootstrap dropdowns are only visible if their parent container has the .open class:

https://github.com/twbs/bootstrap/blob/v3.4.1/less/dropdowns.less#L121

This will fix the example:

image

Without the class the list exists but is never shown:

image

@xcash
Copy link
Owner

xcash commented Nov 9, 2020

Hi @mbrodala and thanks.
Since I'm currently working with BS4 and 5(alpha) I have no time to try to figure out this bug.
Would you mind (or any other who reads) to try to submit a PR to fix it?

@xcash xcash modified the milestone: Future Nov 9, 2020
@mbrodala
Copy link

mbrodala commented Nov 9, 2020

Interestingly the last working version (2.3.5) also sets display: block somehow/somewhere which makes it work:

image

@mbrodala
Copy link

@xcash It would help if you could make another 2.x release with dist/latest/bootstrap-autocomplete.js not being minified.

In any case I'd expect the following to help:

  public show(): void {
    if (!this.shown) {
      this._dd.dropdown().show();
+     this._dd.parent().addClass('open');
      this.shown = true;
    }
  }
  public hide(): void {
    if (this.shown) {
+     this._dd.parent().removeClass('open');
      this._dd.dropdown().hide();
      this.shown = false;
    }
  }

@mbrodala
Copy link

mbrodala commented Aug 30, 2021

From what I can see the proper fix would be backporting the change in 5129a34 (see #83) which was only done for Bootstrap v4 back then.

You can easily confirm that if you enforce Bootstrap 4: the dropdown appears as expected. (But looks broken due to wrong classes of course.)

@mbrodala
Copy link

@xcash Can you create a branch for version 2.x first where PRs could be pushed for?

@mbrodala mbrodala linked a pull request Aug 30, 2021 that will close this issue
@mbrodala
Copy link

Alright, I've ported the fix now: #129

@mbrodala
Copy link

@xcash Not sure what to do about the bootstrap-autocomplete.min.js since a gulp test did only update the bootstrap-autocomplete.js.

@penarrocha
Copy link

@mbrodala thank you very much, I was getting mad until I noticed the inline styles injected to the UL didn't match in versions prior to 2.3.6

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

Successfully merging a pull request may close this issue.

6 participants