Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Search box not shown to search when data is an empty array #1805

Open

Description

@cvNOliveira

I have a ui-select that uses refresh to fetch data from server whenever a user inserts a char in input box (search box).
Since UI-Select v0.19.3 the input box is no longer available when data is an empty array, so the user cannot search to fetch data.
Needless to say that I only want to present data when the user search for it.

This only happens with theme "select2".
With boostrap theme it is ok.

Angular version: 1.5.5
UI-Select: 0.19.3

Activity

  1. user378230 commented on Sep 16, 2016

    @user378230
    Contributor

    Most likely caused by 4c561ac

    @cvNOliveira If you made a plunkr as requested in the github issue template I could have tested in 2 minutes and reverted the commit and resolved this issue. But you didn't 😞

    Can you test reverting the change in the above commit and see if it resolves your problem? If it does, I'll revert in master. Thanks! 👍

  2. cvNOliveira commented on Sep 16, 2016

    @cvNOliveira
    Author

    You are right, my bad! I should have made the plunkr.
    Anyways, I have managed to solve the problem excluding the theme from the condition on line 1388.
    Probably not the best option, but it worked for me.

    Old code:
    if (!uisOffset(dropdown).height && $select.$animate && $select.$animate.on && select.$animate.enabled(dropdown))

    New Code

    var isSelect2Theme = angular.element(element).hasClass("select2");
    if (!uisOffset(dropdown).height && $select.$animate && $select.$animate.on && $select.$animate.enabled(dropdown) && !isSelect2Theme)
    

    I hope it helps.
    Cheers!

  3. user378230 commented on Sep 16, 2016

    @user378230
    Contributor

    Did you try reverting 4c561ac? I thought that would have been the cause... maybe not then.

  4. cvNOliveira commented on Sep 17, 2016

    @cvNOliveira
    Author

    I did not revert that commit because, as far as I can see, it has not to do with multiple choices and that commit is related with select-multiple template.

    In this case, it's an opacity property that remains 0 because, for select2, at some point the animation procedure does not change the opacity to 1.
    Since select2 does not have animation, I disabled the animation procedure for this theme as mentioned in my last comment.

  5. Sparksx commented on Jan 11, 2018

    @Sparksx

    Same problème 2 year after...
    I've made a pr with @cvNOliveira solution, please take a look

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions