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

Tagifying should not happen at blur. #63

Closed
lordmikefin opened this issue Apr 25, 2018 · 3 comments
Closed

Tagifying should not happen at blur. #63

lordmikefin opened this issue Apr 25, 2018 · 3 comments

Comments

@lordmikefin
Copy link

If user is typing tag in the field and moves focus to other component, then tag is created.

This is bit annoying because then you have to remove the tag and retype what you were originally typing.

There should be configuration setting for preventing the tagifying process on field blur.

Of course when tag is not automatically created, then the "last" tag must be created outside of tagify field.

Here is my sample code:

$( "#searchbtn" ).click( function(e) {
// Make sure last input value is tagified.
var text = tagify.DOM.input.value.trim();
if ( text ) {
tagify.DOM.input.value = '';
tagify.addTags(text).length;
}
});

@yairEO
Copy link
Owner

yairEO commented Apr 25, 2018

ok, I will make such configuration.

I was certain this is what everybody wants, to have the tag created on blur event.
This request surprises me. why would a user not finish to type a tag and leave the focus in the middle..? where's the logic in doing that..

@lordmikefin
Copy link
Author

Yep, you are correct, that normally the tag should be created on blur event.

I have created my own "datalist" for the field.

I need different type of selections in the datalist. Suggested tags (what already exists in "real" datalist) and links.
Because I do not use "real" datalist I have to move focus from tagify field into the datalist.
This will create incomplete tag.

Special case -> special logic ;)

yairEO added a commit that referenced this issue Jun 15, 2018
@yairEO yairEO closed this as completed Jun 17, 2018
@yairEO
Copy link
Owner

yairEO commented Jun 17, 2018

See addTagOnBlur settings in the README

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

No branches or pull requests

2 participants