Selectize.js: Hitting Tab won't jump to next field (regression in 0.12.3)

Created on 30 Sep 2016  路  11Comments  路  Source: selectize/selectize.js

Hi,

the behaviour on KEY_TAB is broken in the version 0.12.3.

Here examples to reproduce it:

selectize 0.12.2 (works)
https://jsfiddle.net/sturchyn/b961qfjk/

selectize 0.12.3 (doesn't work)
https://jsfiddle.net/sturchyn/vyggj6oz/

(Given a Selectize with option selectOnTab:true)

Steps to reproduce:

  1. Set focus on the select box.
  2. Select the option 'B'.
  3. Press the key 'TAB'.

Expected result:

  • The option 'B' is selected.
  • The select box is closed.
  • The cursor jumps to the next input field.

Actual result (with 0.12.3):

  • The option 'B' is selected.
  • The select is open.
  • The focus is on the select box.

Many thanks for Selectize :-)

Best regards
Stanislav

bug confirmed regression

Most helpful comment

The issue is still present in 0.12.4 when using the following options

            create: false, 
            preload: true,
            selectOnTab: true,
            sortField: 'name',

and having onChange, render, and load callbacks.

I've gone back to 0.12.2 to avoid the issue.

All 11 comments

Indeed, great report, thanks!

This regression has been introduced by the following change in #1127:
https://github.com/selectize/selectize.js/commit/d7015c9f9f7b218c2c82988ba19756295b1a3698#diff-6cee306935e9c39b0f577d4ccb04fadeR1744

If you comment this line, the tab behavior works as expected.

Any idea how we can fix the iOS issue without breaking the default tab behavior?

@hupf If you get around to a PR, do mention me, I've checked out of notifications but this seems like a priority.

Merged

The issue is still present in 0.12.4 when using the following options

            create: false, 
            preload: true,
            selectOnTab: true,
            sortField: 'name',

and having onChange, render, and load callbacks.

I've gone back to 0.12.2 to avoid the issue.

Just commenting to confirm this issue in 0.12.4 on firefox and IE using following options:

closeAfterSelect: true,
maxItems: 1,
persist: false, // setting this to true has same problem.
create: someFunction

reverting to 0.12.2 solved this particular issue but one issue on firefox remained: tabbing from a selectize field to a regular input field kept focusing back to the selectize field.

This last issue was solved by incrementally setting the tabindex of each input field every time a form is shown:
$("#" + wrapperId + " :input:not(:hidden)").each(function (i) {$(this).attr('tabindex', i + 1); });

Hi @joallard is there any chance that this issue will be resolved in the near future? Would be awesome.

Cheers

Still can't tab out of a selectize input.

Same issue in Firefox 61.0.1 (64-bit). Can't tab past the selectize.

Please release a new version with this fix included!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreypopp picture andreypopp  路  15Comments

brianreavis picture brianreavis  路  66Comments

ghost picture ghost  路  18Comments

notflip picture notflip  路  15Comments

Saeven picture Saeven  路  15Comments