Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Prevent backspace key from clearing selected value #926

Closed
LeleDev opened this issue May 13, 2015 · 10 comments
Closed

Prevent backspace key from clearing selected value #926

LeleDev opened this issue May 13, 2015 · 10 comments

Comments

@LeleDev
Copy link

LeleDev commented May 13, 2015

Is there a way to prevent backspace key from clearing the selected value in ui-select?

Thank you in advance

@iamvaruns
Copy link

I am having the same issue, can someone help ?

@LeleDev
Copy link
Author

LeleDev commented Dec 2, 2015

Still nothing?

@fferraris
Copy link

+1

2 similar comments
@pierregaste
Copy link
Contributor

+1

@AndriyBilyak
Copy link

+1

@danmo
Copy link

danmo commented Apr 6, 2016

Until it's supported by ui-select I had to create an angular directive that patches this: https://gist.github.com/danmo/020cc4ad33b87929b021e5c193a3e25c

pierregaste pushed a commit to pierregaste/ui-select that referenced this issue Jul 25, 2016
… reset

Currently, when you select an option and you press the backspace key, it will reset the model.
With this option, we could disable this behavior to avoid the model resetting.

Closes angular-ui#926 angular-ui#525
user378230 pushed a commit that referenced this issue Nov 2, 2016
Adds `backspace-reset` attribute (default: `true`).

Currently, when you select an option and you press the backspace key, it will reset the model.

Setting `backspace-reset="false"` will disable this behavior and so avoid resetting the model.

Closes #926 #525
kboga pushed a commit to kboga/ui-select that referenced this issue Nov 29, 2016
Adds `backspace-reset` attribute (default: `true`).

Currently, when you select an option and you press the backspace key, it will reset the model.

Setting `backspace-reset="false"` will disable this behavior and so avoid resetting the model.

Closes angular-ui#926 angular-ui#525
@Wizjonero
Copy link

@pierregaste your solution works only on UI Select Single, right?

@pierregaste
Copy link
Contributor

@Wizjonero Yes, that's right!

We cannot use this option with uiSelectMultipleDirective because backspace key is used for remove a selected value.

@CoconutDeveloper
Copy link

@pierregaste was this ever merge? I need this desperately, I'm asking because I don't see it in the documentation at least.

@pierregaste
Copy link
Contributor

@CoconutDeveloper yes it was merged : #1736

I forget to add documentation. You could create a new PR for this ;)

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

No branches or pull requests

9 participants