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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BLOCKED] feat: allow 1-click switch between pickers when open #6785

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Nov 14, 2023

Description

Warning

Blocked by #6817

The PR makes it possible to switch between pickers of date-time-picker with one click when one of them is open. Previously, clicking into the opposite picker while the current picker was open only caused the current picker to close without moving focus to the opposite picker.

Before:

Screen.Recording.2023-11-15.at.9.43.24.mov

After:

Screen.Recording.2023-11-15.at.9.44.06.mov

Fixes #6407

Type of change

  • Bugfix

@vursen vursen changed the title fix: allow switching between pickers with click when any is open fix: enable switching between pickers with click when any is open Nov 14, 2023
@vursen vursen changed the title fix: enable switching between pickers with click when any is open fix: allow switching between pickers with click when any is open Nov 15, 2023
@vursen vursen changed the title fix: allow switching between pickers with click when any is open fix: allow switching between pickers with click when opened Nov 15, 2023
@vursen vursen marked this pull request as ready for review November 15, 2023 08:51
@vursen
Copy link
Contributor Author

vursen commented Nov 15, 2023

Should it be called a fix or feat?

Copy link

sonarcloud bot commented Nov 15, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vursen vursen changed the title fix: allow switching between pickers with click when opened fix: allow 1-click switching between pickers when one of them is open Nov 15, 2023
@vursen vursen changed the title fix: allow 1-click switching between pickers when one of them is open fix: allow 1-click switch between pickers when open Nov 15, 2023
Copy link
Member

@web-padawan web-padawan left a comment

Choose a reason for hiding this comment

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

There is now a problem with focused and focus-ring attributes not getting removed from vaadin-date-picker after focusing vaadin-time-picker and removing focus:

dtp-focused.mp4

@@ -518,16 +519,23 @@ class DateTimePicker extends FieldMixin(DisabledMixin(FocusMixin(ThemableMixin(E
this.__dispatchChangeForValue = undefined;
}

__openedChangedEventHandler() {
Copy link
Member

Choose a reason for hiding this comment

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

nit: let's add @private JSDoc annotation.

@@ -94,6 +95,50 @@ describe('Basic features', () => {
expect(datePicker.hasAttribute('focused')).to.be.true;
});

it('should not have `pointer-events` by default', () => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: could group new tests into separate suite.

@vursen
Copy link
Contributor Author

vursen commented Nov 17, 2023

I've encountered odd behavior in Safari that negatively impacts the UX of this feature. Certain labels, such as "Birth date and time", cause Safari to activate autofill for the date-time-picker pickers, and for some reason, this autofill prevents the first clicks on the pickers, although focus still moves to them.

Screen.Recording.2023-11-17.at.9.38.59.mov

Having that said, I couldn't reproduce it with the regular date-picker and time-picker. I tried various labels, such as "Birth date", "Date" and so on, but none of them caused Safari to activate autofill.

UPD: Reported in #6817.

@vursen vursen changed the title fix: allow 1-click switch between pickers when open [BLOCKED] fix: allow 1-click switch between pickers when open Nov 21, 2023
@vursen vursen changed the title [BLOCKED] fix: allow 1-click switch between pickers when open [BLOCKED] feat: allow 1-click switch between pickers when open Nov 22, 2023
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.

[date-time-picker] Allow clicking into the opposite picker when one of them is open [2 days]
2 participants