Skip to content

[DateRangePicker] Fix selection behavior with single input field when readonly#12593

Merged
LukasTy merged 5 commits intomui:masterfrom
LukasTy:range-readonly
Mar 28, 2024
Merged

[DateRangePicker] Fix selection behavior with single input field when readonly#12593
LukasTy merged 5 commits intomui:masterfrom
LukasTy:range-readonly

Conversation

@LukasTy
Copy link
Copy Markdown
Member

@LukasTy LukasTy commented Mar 28, 2024

Fixes #12576

  • Avoid calling setSelectedSection which forces the range position to be changed after the picker is opened
    This seems to function more similarly to how v7 behavior works.
  • Fix focused styling behavior on range Pickers using a single input field.
    The input received a focused state only when the Picker was opened.
    Now the behavior is better aligned with all other Pickers (including the Range Pickers using multiple fields).
  • Add tests for both cases.

@LukasTy LukasTy added type: bug It doesn't behave as expected. scope: pickers Changes related to the date/time pickers. component: DateRangePicker feature: Keyboard editing Related to the pickers keyboard edition labels Mar 28, 2024
@LukasTy LukasTy self-assigned this Mar 28, 2024
Copy link
Copy Markdown
Member

@michelengelen michelengelen left a comment

Choose a reason for hiding this comment

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

LGTM

@mui-bot
Copy link
Copy Markdown

mui-bot commented Mar 28, 2024

Deploy preview: https://deploy-preview-12593--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 80608ba

@LukasTy LukasTy enabled auto-merge (squash) March 28, 2024 13:57
@LukasTy LukasTy merged commit 2a405a8 into mui:master Mar 28, 2024
michelengelen added a commit to michelengelen/mui-x that referenced this pull request Mar 28, 2024
@LukasTy LukasTy deleted the range-readonly branch March 28, 2024 14:35
DungTiger pushed a commit to DungTiger/mui-x that referenced this pull request Jul 23, 2024
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: Keyboard editing Related to the pickers keyboard edition scope: pickers Changes related to the date/time pickers. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DateRangePicker] Using SingleInputDateRangeField with readOnly=true causes unexpected UX

4 participants