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

Sync with original select's changes #45

Open
panych opened this issue Sep 4, 2015 · 1 comment
Open

Sync with original select's changes #45

panych opened this issue Sep 4, 2015 · 1 comment

Comments

@panych
Copy link

panych commented Sep 4, 2015

Hello, thanks for nice plugin.

Problem: fake and original selects don't synchronize properly when original changed programmatically.
Case: change original select programmatically (E.g.: selectElement.selectedIndex = 2).

In this case ikSelect doesn't update itself. And there is no method to do this manually, something like "sync" or "refresh".

I've found a workaround, but it's haky a little bit:

$('select.mySelect').ikSelect('showDropdown').ikSelect('hideDropdown');

So it's looks like there is two options:

  1. make an auto synchronization (didn't investigate yet), or
  2. add a public method to synchronize fake and original selects.
@panych
Copy link
Author

panych commented Nov 9, 2015

My previous workaround with showDropdown and hideDropdown is bad: native select could stay open on iPad2. Also it leaves focus on last select. Better way to use select method:

$('select').each(function() { $(this).ikSelect('select', this.value) });

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

No branches or pull requests

1 participant