mui / mui/base-ui

[docs] Add examples showing how to position native validation tooltips

Open
#3,828 2 comments 2 reactions 0 assignees View on GitHub
docs
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

It's clear that there is a need to improve the documentation and/or DX regarding properly placing the native validation tooltip on components using a hidden native input.
This mainly concerns Select, Combobox, and Number Field components.

> Just reviewed the code. Cool so you're essentially doing the same:
>
> 1. `!important`
> 2. a selector to target the hidden input
>
> ```
> & + input[aria-hidden='true'] {
> width: 100% !important;
> padding-left: 0.875rem !important;
> }
> ```
>
> My only ask would be to expose a prop like `hiddenInputStyles: { width: '100%', paddingLeft: '0.875rem' }` (or `hiddenInputStyleOverrides` etc.) so you wouldn't have to resort to `!important` or figure out the right selector to target the hidden input.

_Originally posted by @NMinhNguyen in [#3718](https://github.com/mui/base-ui/issues/3718#issuecomment-3769628669)_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.