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

TimeField resets dayPeriod segment when hour value is deleted #6793

Open
dspnorman opened this issue Jul 29, 2024 · 5 comments · May be fixed by #7506
Open

TimeField resets dayPeriod segment when hour value is deleted #6793

dspnorman opened this issue Jul 29, 2024 · 5 comments · May be fixed by #7506
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers RAC rsp:TimeField

Comments

@dspnorman
Copy link

Provide a general summary of the issue here

For TimeField values greater than or equal to 12, clearing the hour segment input causes the dayPeriod segment value to flip from "PM" to "AM".

🤔 Expected Behavior?

Each segment of a TimeField can be edited in place, and modifying the value of one segment input does not alter the value of the others, eg. clearing an hour value does not cause dayPeriod to change from "PM" to "AM" or vice-versa.

😯 Current Behavior

  • when a TimeField value includes an hour >= 12, and
  • the hour segment has focus, and
  • the user presses the delete key to clear the hour value

…the dayPeriod segment changes from "PM" to "AM"

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

  • enter a time with an hour greater than or equal to 12 in a TimeField
    • eg. on component documentation example, type "6:45 PM"
  • move focus to the hour segment
  • press delete
Screen.Recording.2024-07-29.at.11.55.01.AM.mov

Version

[email protected]

What browsers are you seeing the problem on?

Chrome

If other, please specify.

also in Safari

What operating system are you using?

macOS 14.5

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@LFDanLu
Copy link
Member

LFDanLu commented Jul 30, 2024

We may be able to implement this by adding another check here that is along the lines of the following (still needs more testing)

      } else if (part === 'hour' && 'hour' in displayValue && displayValue.hour >= 12 && validSegments.dayPeriod) {
        value = displayValue.set({hour: placeholder['hour'] + 12});
      }

@LFDanLu LFDanLu added enhancement New feature or request rsp:TimeField RAC labels Jul 30, 2024
@github-project-automation github-project-automation bot moved this to ✏️ To Groom in RSP Component Milestones Aug 2, 2024
@LFDanLu LFDanLu added the good first issue Good for newcomers label Aug 7, 2024
@parthsali
Copy link

Hi @LFDanLu,

I would like to work on this issue. Could you please assign it to me or let me know if there are any specific requirements or guidelines I should follow?

Thank you!

@LFDanLu
Copy link
Member

LFDanLu commented Aug 20, 2024

Sure go for it! I would make sure to read through https://react-spectrum.adobe.com/contribute.html#contribute first. Other than that, feel free to reach out if you have any questions/concerns.

@charlotte-whiting
Copy link

Hey @LFDanLu,

I noticed there was some activity on this issue, but it looks like it's still open/unassigned. Could I possibly work on this, or is it no longer available? Also would appreciate any advice if the issue is free to work on!

Thanks!

@LFDanLu
Copy link
Member

LFDanLu commented Nov 21, 2024

@charlotte-whiting Sure, go for it! I believe the comment still applies, so you can give that a shot and test locally to make sure it still does. As mentioned above as well, be sure to read through https://react-spectrum.adobe.com/contribute.html#contribute first!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers RAC rsp:TimeField
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants