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

Free input always allowed on objects #30

Closed
kennethlarsen opened this issue Oct 11, 2016 · 2 comments
Closed

Free input always allowed on objects #30

kennethlarsen opened this issue Oct 11, 2016 · 2 comments

Comments

@kennethlarsen
Copy link

When using objects instead of strings as suggestions free input is always allowed and allowFreeInput doesn't have any effect.

@kennethlarsen
Copy link
Author

If #29 was implemented something like this would work:

    t.on('focusout', run.bind(this, (/*jqEvent*/) => {
      //the user has now left the control, update display with current binding or reset to blank
      const model = this.get('selection');
      if (this.get('allowFreeInput')) {
        const value = this.get('_typeahead').typeahead('val');
        this.set('selection', value);
        this.sendAction('action', value);
      } else if (model !== null && typeof model === 'object') {
        this.setValue(model);
      } else {
        this.get('_typeahead').typeahead('val', null);
      }
    }));

@jackmatt2
Copy link
Member

Fixed by #31

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

2 participants