indrimuska / angular-selector

A native AngularJS directive that transform a simple <select> box into a full html select with typeahead.
http://indrimuska.github.io/angular-selector
MIT License
96 stars 36 forks source link

Disable search field #53

Closed error414 closed 8 years ago

error414 commented 8 years ago

When I used angular-select in mobile, compiled by cca, I had problem with search field, because when i clicked to select, SW keyboard atomaticcaly appeared, because search field got focus. It is quite unusable.

I found one solution "readonly", it works fine for me.

indrimuska commented 8 years ago

Hi @error414, very interesting feature, good job! At the moment, if the selector already has a value, by focusing on the input field you'll be able to remove that (the last) selected item by hitting Backspace. What I realized is that this behavior won't be the same if you set the field to a readonly state, isn't it?

error414 commented 8 years ago

Hi,

you are doing greate job :).

You right, with backspace is problem, backspace can delete value from select but backspace has other unplesant property. If "select" has value and I press backspace so backspace can delete value but moreover backspace invoke action "go back in history". This problem isn't on mobile or chrome app.

I have to find solution for this.

BTW: do you have some E2E tests?

error414 commented 8 years ago

Hi,

I found solution, maybe. Can you check it, please?

indrimuska commented 8 years ago

Ok, I created a plunker example with your solution, and it seems to work great with Backspace button, but it also generates another big problem: when I remove a value form the select, I am not able to type something anymore.

This is the plunker: http://plnkr.co/edit/zpkhbXZHoB7bklCVffxI?p=preview


EDIT: I don't have E2E test nor any other test, 'cause I don't have the time to create them by myself. It would be very great if you could contribuite to their creation :)

error414 commented 8 years ago

I am not sure that I know what you mean. Can you create video, or somethink like that? I found one bug but it is on production code too. https://youtu.be/v1x9PUZCQsc

indrimuska commented 8 years ago

Check out this GIF image (click on it to view it larger):

ezgif-593614563

error414 commented 8 years ago

It is exactly what my patch do. Base problem is on mobile devices, if "search's input" get focus so android (I tested it only in android) will open SW keyboard. I know only one solution for this, and it is disable search field. Use SW keyboard on mobile for search in select is unconfortable, because mobile devices have small screen. "disable-search" is only for mobile devices. On PC isn't reason why disable it. "disable search" mean that you cant type anythink to select.

indrimuska commented 8 years ago

Ok, now I understand why you've named the feature disableSearch! Well done, let's go for it. It needs a little update, but don't worry, I'll do it after merging the PR.