Let a select, a password and a file field span its container

<x-input>, <x-textarea> and <x-datepicker> took `full` to drop the 40rem
bound field.css puts on a text field from `medium`; <x-select>,
<x-password> and <x-file> did not, so a field inside a container that
already bounds it stopped short of that container's edge with no way to
say so. The three now take the prop and hand it to <x-field> like the
others. <x-choices> and <x-timepicker> still do not.

Found in SealShare: its share options, its admin settings and its user
settings are cards, and a card is exactly the "other container" M3 names
as the thing that should bound a field on a medium or expanded screen
instead of the 40rem ceiling.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andreas Reinhold / reini
2026-09-15 22:23:05 +02:00
co-authored by Claude Opus 5
parent 5b05e52e1c
commit 5014d3e576
3 changed files with 9 additions and 6 deletions
+3 -2
View File
@@ -11,12 +11,13 @@
it cannot be truncated or wrapped, and the caller shows what was chosen anyway, as previews. A it cannot be truncated or wrapped, and the caller shows what was chosen anyway, as previews. A
screen reader still hears it. The errors are the model's and, for a `multiple` input, each screen reader still hears it. The errors are the model's and, for a `multiple` input, each
file's (`photos.*`): a file refused for its size belongs under this field as much as the file's (`photos.*`): a file refused for its size belongs under this field as much as the
batch's own count does. `label`, `hint`, `variant`; every other attribute reaches the `<input>`. --}} batch's own count does. `label`, `hint`, `variant`; `full` takes the 40rem bound off a field its container already bounds. Every other attribute reaches the `<input>`. --}}
@props([ @props([
'label' => null, 'label' => null,
'hint' => null, 'hint' => null,
'variant' => null, 'variant' => null,
'full' => false,
]) ])
@php @php
@@ -29,7 +30,7 @@
: []; : [];
@endphp @endphp
<x-livewire-material::field :$id :$label :$hint :$messages :$variant floated :class="$attributes->get('class')" :style="$attributes->get('style')" data-md-file> <x-livewire-material::field :$id :$label :$hint :$messages :$variant :$full floated :class="$attributes->get('class')" :style="$attributes->get('style')" data-md-file>
<input <input
{{ $attributes->except(['class', 'style', 'id', 'type']) }} {{ $attributes->except(['class', 'style', 'id', 'type']) }}
type="file" type="file"
@@ -4,7 +4,7 @@
password manager still sees a password input on load. Its label says what pressing it will do password manager still sees a password input on load. Its label says what pressing it will do
M3's own pattern for an interactive trailing icon ("Show password" / "Hide password") — and it M3's own pattern for an interactive trailing icon ("Show password" / "Hide password") — and it
carries no `aria-pressed`, which would say the state a second time and the other way round. carries no `aria-pressed`, which would say the state a second time and the other way round.
`label`, `hint`, `icon`, `variant`, `size`; `class` and `style` land on the field's root, every `label`, `hint`, `icon`, `variant`, `size`; `full` takes the 40rem bound off a field its container already bounds. `class` and `style` land on the field's root, every
other attribute reaches the `<input>` other attribute reaches the `<input>`
(`autocomplete="current-password"`, `wire:model`). The field's root carries (`autocomplete="current-password"`, `wire:model`). The field's root carries
`data-md-password`; the chrome and the eye's icon button are the field's `data-md-password`; the chrome and the eye's icon button are the field's
@@ -17,6 +17,7 @@
'icon' => null, 'icon' => null,
'size' => 'md', 'size' => 'md',
'variant' => null, 'variant' => null,
'full' => false,
]) ])
@php @php
@@ -28,7 +29,7 @@
$fieldIconSize = ['sm' => 20, 'xs' => 16][$size] ?? 24; $fieldIconSize = ['sm' => 20, 'xs' => 16][$size] ?? 24;
@endphp @endphp
<x-livewire-material::field :$id :$label :$hint :hint-class="$hintClass" :$messages :$icon :$size :$variant :class="$attributes->get('class')" :style="$attributes->get('style')" x-data="{ shown: false }" data-md-password> <x-livewire-material::field :$id :$label :$hint :hint-class="$hintClass" :$messages :$icon :$size :$variant :$full :class="$attributes->get('class')" :style="$attributes->get('style')" x-data="{ shown: false }" data-md-password>
<input <input
{{ $attributes->except(['class', 'style', 'id', 'type', 'placeholder']) }} {{ $attributes->except(['class', 'style', 'id', 'type', 'placeholder']) }}
id="{{ $id }}" id="{{ $id }}"
+3 -2
View File
@@ -10,7 +10,7 @@
`options` as a list of `['id' => …, 'name' => …]` (`'disabled' => true` greys one out), `options` as a list of `['id' => …, 'name' => …]` (`'disabled' => true` greys one out),
`option-value` and `option-label` to read other keys, and a `placeholder` that becomes the `option-value` and `option-label` to read other keys, and a `placeholder` that becomes the
first option, valued `placeholder-value` (empty by default). Or pass `<option>`s in the slot. first option, valued `placeholder-value` (empty by default). Or pass `<option>`s in the slot.
`label`, `hint`, `icon`, `variant`, `size`; `class` and `style` land on the field's root, every `label`, `hint`, `icon`, `variant`, `size`; `full` takes the 40rem bound off a field its container already bounds. `class` and `style` land on the field's root, every
other attribute on the `<select>`. The field's root carries `data-md-select`; what a other attribute on the `<select>`. The field's root carries `data-md-select`; what a
select changes in the field's chrome is resources/css/components/select.css. --}} select changes in the field's chrome is resources/css/components/select.css. --}}
@@ -26,6 +26,7 @@
'placeholderValue' => null, 'placeholderValue' => null,
'size' => 'md', 'size' => 'md',
'variant' => null, 'variant' => null,
'full' => false,
]) ])
@php @php
@@ -37,7 +38,7 @@
$fieldIconSize = ['sm' => 20, 'xs' => 16][$size] ?? 24; $fieldIconSize = ['sm' => 20, 'xs' => 16][$size] ?? 24;
@endphp @endphp
<x-livewire-material::field :$id :$label :$hint :hint-class="$hintClass" :$messages :$icon :$size :$variant floated :class="$attributes->get('class')" :style="$attributes->get('style')" data-md-select> <x-livewire-material::field :$id :$label :$hint :hint-class="$hintClass" :$messages :$icon :$size :$variant :$full floated :class="$attributes->get('class')" :style="$attributes->get('style')" data-md-select>
<select <select
{{ $attributes->except(['class', 'style', 'id']) }} {{ $attributes->except(['class', 'style', 'id']) }}
id="{{ $id }}" id="{{ $id }}"