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

Feature Request: Add chips on mouse blur? #5528

Closed
KeithNdhlovu opened this issue Jan 8, 2018 · 4 comments
Closed

Feature Request: Add chips on mouse blur? #5528

KeithNdhlovu opened this issue Jan 8, 2018 · 4 comments

Comments

@KeithNdhlovu
Copy link

      self.$document.off('blur.chips-add', SELS.CHIPS + ' ' + SELS.INPUT).on('blur.chips-add', SELS.CHIPS + ' ' + SELS.INPUT, function(e){
        var $target = $(e.target);
        var $chips = $target.closest(SELS.CHIPS);
        var chipsLength = $chips.children(SELS.CHIP).length;

        e.preventDefault();
        self.addChip({tag: $target.val()}, $chips);
        $target.val('');
        return;
      })
@KeithNdhlovu
Copy link
Author

The Challenging part of this is determining the mode of adding a chip, like choosing between "pressing enter to add chip" and "just click away to add a chip", would be nice if as a developer i could supply such a mode on the initialization of the chips' options

@Dogfalo
Copy link
Owner

Dogfalo commented Jan 10, 2018

From the implementations we've seen, we don't think it needs to chip on mouse blur.

@Dogfalo Dogfalo closed this as completed Jan 10, 2018
@Hypnos3
Copy link

Hypnos3 commented Jan 30, 2018

A use case on Angular css, which is already solved there

My use case is similar: In this case the user can anter a module and then press "save" or "save and close", The entered "test" will not be saved and the user has no change to recognize this because they don't know to press ENTER after input:
image
This isn't very intuitive.

@egarcia-add
Copy link

$('#id').find('input').on('blur', function() { let value = $('#id').find('input').val(); if ( value != '') { $('#id').find('input').val(''); $('#id').chips('addChip', {tag: 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

4 participants