Skip Navigation

Tabbing through Toolset “Select2” inputs will reset the tab focus if an option in a “Select2” instance is chosen

Open

Reported for: Toolset Forms 2.3.6

Symptoms

When you have Select2 inputs in a Toolset form (e.g. parent post selectors in a one-to-many relationship, where the form applies to the child post), and use the TAB key to move through the form on the front-end, then selecting an option in the Select2 inputs will provoke the next TAB click to reset the current location.

This means after selecting the option in Select2, pressing TAB will not lead to the next input but back to the top of the page.

 

Workaround

This is a known bug in Select2 4.0.3 version that Toolset uses.

Until Toolset updates its version to 4.0.7 (which solves this bug) you can add the following snippet to your form addressing the Select2 Items:
jQuery('select').on(
'toolset_select2:select',(
function(){
jQuery(this).focus();
}
)
);

Leave
a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>