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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: setTouched on Select Close instead of Open #231

Merged
merged 1 commit into from
Feb 4, 2018
Merged

fix: setTouched on Select Close instead of Open #231

merged 1 commit into from
Feb 4, 2018

Conversation

distributedlock
Copy link
Contributor

@distributedlock distributedlock commented Feb 3, 2018

This will set touched on closing the option instead of open.

A typical HTML Select in Angular will set touched once the user
mouse clicks out or tabs (keyboard) out. This will emulate that
same behaviour. Setting touched right away on open causes
weird user experience when displaying error message that
typically depend on touched being set. We want to let
the user interact with the select and once done interaction,
it is to be set touched.

PR Closes #225. A modification to the change in PR #228.

Would greatly appreciate if you can include in this a new version or recut version 0.17.0 with this included this PR is accepted. Awesome job on this great library 馃憤

/cc @anjmao

This will set `touched` on closing the option instead of open.

A typical HTML Select in Angular will set touched once the user
mouse clicks out or tabs (keyboard) out. This will emulate that
same behaviour. Setting `touched` right away on open causes
weird user experience when displaying error message that 
typically depend on `touched` being set. We want to let
the user interact with the select and once done interaction,
it is to be set `touched`.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 90.943% when pulling 97ef8fc on RanadeepPolavarapu:fix/setTouchedOnClose into 92b347d on ng-select:master.

@varnastadeus
Copy link
Member

varnastadeus commented Feb 3, 2018

@ranadeeppolavarapu if you have [closeOnSelect] false, dropdown won't close and will stay untouched. Probably we need to set touched in few cases, not only on close.

Copy link
Member

@anjmao anjmao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, @ranadeeppolavarapu thanks :) I released 0.17.1 version to npm.
@varnastadeus Yes, but it will be set to touched ones dropdown is closed by clicking outside of dropdown or using tab.

@anjmao anjmao merged commit 50a2e3c into ng-select:master Feb 4, 2018
jakemdunn pushed a commit to jakemdunn/ng-select that referenced this pull request Oct 16, 2018
closes ng-select#225 
This will set `touched` on closing the option instead of open.
A typical HTML Select in Angular will set touched once the user
mouse clicks out or tabs (keyboard) out. This will emulate that
same behaviour. Setting `touched` right away on open causes
weird user experience when displaying error message that 
typically depend on `touched` being set. We want to let
the user interact with the select and once done interaction,
it is to be set `touched`.
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

Successfully merging this pull request may close these issues.

None yet

4 participants