Fix Enter key usage with 'This month' button in month input popup
Fix an issue where focusing the 'This month' button in a month input popup and pressing 'Enter' would close the popup but not switch to the current month. The problem was that the MonthPicker.onKeyDown_ handler was receiving the event first and submitting the popup with the current value (which was the correct behavior for an 'Enter' keypress anywhere else in the popup). With this fix, the onKeyDown_ handler skips the event if the target was the 'This month' button so that MonthPicker.onTodayButtonClick_ can handle it correctly. An alternative solution that I explored was to move the element for the 'This month' button under the YearListView so that the button's event handler would be triggered before the keydown handler on the MonthPicker, but this caused problems with the popup layout while leaving other issues with the event ordering, so I chose to go with the simpler solution found in this CL. Bug: 1054469 Change-Id: I4f32b6ca8b71b7e700e63c8e2d45429df74dce27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067718Reviewed-by:Ionel Popescu <iopopesc@microsoft.com> Reviewed-by:
Mason Freed <masonfreed@chromium.org> Commit-Queue: Dan Clark <daniec@microsoft.com> Cr-Commit-Position: refs/heads/master@{#744080}
Showing
Please register or sign in to comment