This repository has been archived by the owner on May 29, 2019. It is now read-only.
datepicker popup return the focus to the wrong element #6069
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
datepicker popup return the focus to the wrong element after setting
close-on-date-selection=true
datepicker-append-to-body=true
uid-datepicker-popup return the focus to the root uipicker element instead of the input.
this made after this commit
way to reproduce:
close-on-date-selection=true
datepicker-append-to-body=true
Observe :
On line the focus suppose to return to the input element but after your fix the focus is being set to the table which is being removed from the DOM after clicking on the button and the focus is passed to the parent element the body.
So i returned to the original issue #5754 and tried to understand why ng-keydown is not being fired.
I realized that after clicking on date button the focused element is the button itself and because ng-keydown is being set to
self.element[0]
keydown event is not being invoked.I managed to come with 2 solutions to this problem:
contenteditable="true"
attribute and it's solving the problems because now ng-keydown is being invoked on any ofself.element[0]
children's.self.element[0];
children's and theself.element[0]
itself.I think the first approach it's better then the other.
i created this plunker to illustrate the first approach.