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

[docs] Improve the documentation of the picker's onChange and onAccept props #13543

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Jun 19, 2024

Follow up on #13511

@flaviendelangle flaviendelangle added docs Improvements or additions to the documentation component: pickers This is the name of the generic UI component, not the React module! labels Jun 19, 2024
@flaviendelangle flaviendelangle self-assigned this Jun 19, 2024
@mui-bot
Copy link

mui-bot commented Jun 19, 2024

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

The improvement looks great! 👏
I'm just not sure about the heading structure. 🙈
Maybe we could avoid the additional 5th level nesting?


:::info
In all the below scenarios, the picker closes when `onClose` is called, except if you are controlling the `open` prop.
:::

#### When the last view is completed
##### When the last view is completed
Copy link
Member

Choose a reason for hiding this comment

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

How do you feel about this h5?
To me, the resulting structure doesn't look the best. 🙈
Maybe that is the reason why we don't have h5 anywhere in the docs? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

How do you think we could avoid it?

  • Replace the current h5 with bullet points?
  • Remove the current h2 and move its information to the current h3?
  • Keep the current h4 as direct child of the current h3 (do not add the "When is XXX called?" level)?
  • something else?

Copy link
Member

Choose a reason for hiding this comment

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

I'm in favor of 2nd or 3rd option, but 2nd one doesn't feel right given the current page structure (fields lifecycle, pickers lifecycle).
This technically leaves us with 3rd option, I don't have any better suggestion without refactoring the page structure. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

We can consider refactoring the page structure if it allows to have a better result.

@@ -44,13 +44,15 @@ Note how changing the value of the start date section will call `onChange` even

## Pickers lifecycle

### When is `onClose` called?
### `onClose`
Copy link
Member

Choose a reason for hiding this comment

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

WDYT about dropping the code block for these headings where the callback is the only word? 🤔

Suggested change
### `onClose`
### onClose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants