Code Monkey home page Code Monkey logo

Comments (3)

romgrk avatar romgrk commented on July 18, 2024 3

The UX seems better for fully highlighted text, I'd be in favor of restoring that behavior.

from mui-x.

michelengelen avatar michelengelen commented on July 18, 2024

This is actually different than the normal input behavior where an input that has text in it will select all of the text on focus. At first I thought this is a requirement for accessibility by WCAG standard, but it actually is not. From the WCAG docs:

  • When text fields receive focus, a vertical bar is displayed in the field, indicating that the user can insert text, OR all of the text is highlighted, indicating that the user can type over the text.
  • When a user interface control receives focus, a visible border is displayed around it.

In our case we support this standard by the second option already, so from a accessibility standpoint there is no need for action.

From a UX perspective this is a bit different and, IMO, highly opinionated. I myself do not like it when the text is selected in full when receiving focus.

If you still want to go back to the previous behaviour you could do this in 2 ways:

  1. Create your own custom edit component, where you have full control over the focus and all related events
  2. listen on the editing events, rowEditStart/cellEditStart. From there you can grab the input and select all text.

Option 2 is honestly a bit harder to accomplish.
Keep in mind that you are responsible for the tab-sequence when you provide custom components in the renderEditCell method. For reference: Tab sequence

Anything to add @MBilalShafi @romgrk ?

from mui-x.

michelengelen avatar michelengelen commented on July 18, 2024

In that case I will add this to the board

from mui-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.