From 23f2bdabf9d71cb4ed352f211270221d1ac18e68 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Mon, 14 Sep 2026 14:11:40 +0200 Subject: [PATCH] Move the select's rules out of the field into select.css MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit marks its field root data-md-select, and what a in the text field's chrome, drawn as M3's exposed dropdown menu + * (resources/views/components/select.blade.php). + * + * The chrome is the field's (components/field.css); this file is what a except(['class', 'id']) }} id="{{ $id }}" diff --git a/tests/Feature/Components/FieldTest.php b/tests/Feature/Components/FieldTest.php index 60a933d8..d0abd905 100644 --- a/tests/Feature/Components/FieldTest.php +++ b/tests/Feature/Components/FieldTest.php @@ -127,6 +127,8 @@ it('draws a native select whose label always floats', function () { expect($html) ->toContain('data-md-floated') + ->toContain('data-md-select') + ->toMatch('/]*data-md-field-control)[^>]*>/') ->toContain('toContain('wire:model="hours"') ->toContain('') @@ -266,3 +268,13 @@ it('draws what a textarea changes in the field from its own stylesheet', functio ->and((string) file_get_contents(__DIR__.'/../../../resources/css/components/field.css'))->not->toContain('textarea[') ->and((string) file_get_contents(__DIR__.'/../../../resources/css/components.css'))->toContain("@import './components/textarea.css';"); }); + +it('draws what a select changes in the field from its own stylesheet', function () { + $css = (string) file_get_contents(__DIR__.'/../../../resources/css/components/select.css'); + + expect($css)->toContain("@import './field.css';") + ->toContain('@supports (appearance: base-select)') + ->toContain('select[data-md-field-control]:open') + ->and((string) file_get_contents(__DIR__.'/../../../resources/css/components/field.css'))->not->toContain('select[') + ->and((string) file_get_contents(__DIR__.'/../../../resources/css/components.css'))->toContain("@import './components/select.css';"); +});