material icon indicating copy to clipboard operation
material copied to clipboard

chips: allow disable text input

Open ilovett opened this issue 11 years ago • 12 comments

Add option to only disabled the keyboard / input aspect of md-chips while allowing mouse clicks on the delete button. This would essentially become a list of filters which have been selected elsewhere, perhaps in conjunction with a very large multi select. Clicking on X would de-select the filter and remove it from the model list.

ilovett avatar Nov 17 '15 22:11 ilovett

Sounds great. How you imagine this feature? an extra attribute for the chips directive? Or you have any other thinks?

devversion avatar Nov 17 '15 22:11 devversion

Immediately I'd think to turn readonly into accepting mixed boolean/array of strings of which components to enable/disable.

But really I think that the md-chips directive is too tightly coupled to having an input and might want to have a md-chips-input wrapper. The spec's chips doesn't neccessarily have inputs: https://www.google.com/design/spec/components/chips.html#

ilovett avatar Nov 17 '15 23:11 ilovett

I think readonly with an expression isn't a good idea, we should provide another attribute like ng-deleteonly (for example). What do you think?

About tightly coupled, we can easily change the template of the chips, so the attribute needs to be static and not a binding.

devversion avatar Nov 17 '15 23:11 devversion

Hold on–how would you delete a chip from the keyboard? It still needs to be operable from an accessibility perspective.

marcysutton avatar Nov 18 '15 19:11 marcysutton

You're right, I should have worded this better. The idea is not to disable keyboard altogether, just remove the text input field. Users can still focus via keyboard, and backspace would behave the same. But moving focus forward would not place focus in an input field where the user can type. Instead it would move on to the next focusable item.

ilovett avatar Nov 18 '15 19:11 ilovett

@marcysutton Already done in my Pull Request, check it out ;) #5799

devversion avatar Nov 18 '15 19:11 devversion

wow that was fast @DevVersion !

ilovett avatar Nov 18 '15 19:11 ilovett

:+1: You can also check and build the PR :smile:

devversion avatar Nov 18 '15 19:11 devversion

+1

ranc avatar Jan 05 '16 16:01 ranc

@topherfangio moved this to your plate cause you're in charge on the ongoing PR

EladBezalel avatar Jan 09 '16 10:01 EladBezalel

can any one tel me how to changed the mat-chip input color when it is disabled mode... i want to change border-bottom : 1px dashed #ddd..Now it will show the mat-form-field style

1993senthil avatar Jun 13 '18 02:06 1993senthil

@1993senthil Please submit Angular Material questions here and issues here. This repo is for AngularJS Material.

Splaktar avatar Jun 17 '18 05:06 Splaktar