Repository navigation
Commit 78d4f12
authored
[material_ui] Document that TextField.decoration is merged with InputDecorationTheme (#12493)
`TextField.decoration`'s dartdoc describes what the decoration draws, but never mentions that the value passed here is *combined* with the ambient `InputDecorationTheme` rather than replacing it.
`TextField` builds its effective decoration with `InputDecoration.applyDefaults` (`packages/material_ui/lib/src/text_field.dart`), and `applyDefaults` only substitutes properties that are null on the incoming `InputDecoration` — including `border: border ?? theme.border` (`packages/material_ui/lib/src/input_decorator.dart`). So a theme-provided border survives an `InputDecoration` that simply omits one, which is surprising if you read the property docs alone. That confusion is what flutter/flutter#159629 reports.
This adds a paragraph to the `decoration` property documenting the merge and pointing at the explicit opt-out (`InputBorder.none`).
This covers the documentation half of flutter/flutter#159629. The issue also proposes a `mergeWithTheme`-style flag on `InputDecoration`; that is an API proposal and is deliberately left out of this PR, so the issue should stay open.
Originally opened against `flutter/flutter` as flutter/flutter#191260, and moved here after the code-freeze bot pointed out that Material changes now belong in `material_ui`.
*Documentation-only change; no behavior change and no new tests.*1 parent b0abd88 commit 78d4f12
2 files changed
Lines changed: 13 additions & 0 deletions
File tree
- packages/material_ui
- lib/src
- pending_changelogs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
451 | 460 | | |
452 | 461 | | |
453 | 462 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments