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

TAB key does nothing in single-value mode when enforceWhitelist is true #903

Closed
krishraghuram opened this issue Sep 15, 2021 · 4 comments
Closed
Labels

Comments

@krishraghuram
Copy link

This issue is similar to #725.

Basically, using "TAB" to navigate to the next input element does not work in single value select mode when enforceWhitelist is also set as true. Can be observed in demo page.

@krishraghuram
Copy link
Author

I think I found the root cause,

tagify/src/parts/events.js

Lines 216 to 218 in e2a0578

if( this.settings.mode == 'select' && this.settings.enforceWhitelist && this.value.length ){
e.preventDefault()
}

Changing that to the following worked for me,

if( this.settings.mode == 'select' && this.settings.enforceWhitelist && this.value.length ){
    if (e.key != 'Tab') {
        e.preventDefault()
    }
}

@yairEO
Copy link
Owner

yairEO commented Sep 18, 2021

Thanks for catching. No need for double-"if" statements, it should be done inside the same one :)

@yairEO yairEO added the Bug label Sep 18, 2021
krishraghuram added a commit to krishraghuram/tagify that referenced this issue Sep 19, 2021
@krishraghuram
Copy link
Author

Raised PR - #909

@yairEO yairEO closed this as completed in de2b058 Sep 21, 2021
@Tagirijus
Copy link

Works now. Thank you so much for your frequent updates! (=

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

No branches or pull requests

3 participants