mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[pickers] text is highlighted after picking date

Open SaebAmini opened this issue 7 months ago • 2 comments

Steps to reproduce

This issue is already described here: https://github.com/mui/mui-x/issues/8145

And seemed to have been later on fixed here: https://github.com/mui/mui-x/pull/8228

However, there seems to be a regression as it's happening on the latest version again:

Image

Your environment

npx @mui/envinfo
  System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.0 - C:\Program Files\nodejs\npm.CMD   
    pnpm: Not Found
  Browsers:
    Chrome: Not Found
    Edge: Chromium (134.0.3124.72)
  npmPackages:
    @emotion/react: ^11.13.3 => 11.14.0 
    @emotion/styled: ^11.13.0 => 11.14.0
    @mui/core-downloads-tracker:  7.1.0
    @mui/icons-material: ^7.1.0 => 7.1.0
    @mui/material: ^7.1.0 => 7.1.0
    @mui/private-theming:  7.1.0
    @mui/styled-engine:  7.1.0
    @mui/system:  7.1.0
    @mui/types:  7.4.2
    @mui/utils:  7.1.0
    @mui/x-charts: ^7.29.1 => 7.29.1
    @mui/x-charts-vendor:  7.20.0
    @mui/x-date-pickers: ^7.29.4 => 7.29.4
    @mui/x-internals:  7.29.0
    @types/react: ^18.3.10 => 18.3.20
    react: ^18.3.1 => 18.3.1
    react-dom: ^18.3.1 => 18.3.1
    typescript: ^5.6.2 => 5.8.2

Search keywords: datepicker, highlight, selection

SaebAmini avatar Jun 04 '25 06:06 SaebAmini

Could you please provide a reproduction of your implementation? It seems you have some custom things going on as well as a different formatting.

I cannot reproduce this on the docs, so it does seem to work correctly OOTB

michelengelen avatar Jun 05 '25 07:06 michelengelen

This issue has been inactive for 7 days. Please remove the stale label or leave a comment to keep it open. Otherwise, it will be closed in 5 days.

github-actions[bot] avatar Jun 15 '25 03:06 github-actions[bot]

This issue has been closed due to 5 days of inactivity after being marked stale.

github-actions[bot] avatar Jun 20 '25 15:06 github-actions[bot]

I'm not sure if it's counted as a minimal reproduction of the issue, but the same issue can be seen on the Mui documentation page for the DateRangePicker field on the "Use a multi input field" section.

  1. Visit page
  2. Open dev tools and switch the dimensions to a mobile device
  3. Click on the "Start" field of the multi-input box
  4. Select any single date
  5. Click "OK"
  6. Notice that some of the text in the "Start" text input box is now selected

It is expected that the text would not be selected after clicking the "OK" button because the focus should not be returned to the text input box.

For me, none of the fixes from https://github.com/mui/mui-x/issues/8145 solved the issue

benjeater avatar Jul 30 '25 10:07 benjeater