Repository navigation
Fix Airbnb dark mode and rework the picker input - #159
Closed
Willis1776 wants to merge 1 commit into
Closed
Willis1776 wants to merge 1 commit into
Willis1776 wants to merge 1 commit into
Conversation
Four related issues with the non-native picker: Airbnb theme in dark mode. The upstream Airbnb theme is light only, but index.css forces a dark surface onto `.dark .flatpickr-calendar`, leaving near-black text on it. Dark overrides now live in resources/css/themes/airbnb.css. Because bin/build.js overwrites resources/dist/themes from node_modules on every build, it now appends any matching resources/css/themes/<theme>.css to the copied theme, so the fixes survive a rebuild. First click on a day was swallowed. Clicking a day blurs the input, and the blur handler ran commitManualInput() -> fp.clear() -> redraw(), replacing the day element between mousedown and mouseup so the click never landed. Mousedown inside the calendar is now prevented so focus never leaves the input (except for the year/time inputs and month dropdown, which must stay focusable), blur is ignored while the picker is open since onClose already commits, and commitManualInput no longer clears when there is nothing to clear. Calendar prefix icon. prefixIcon defaults to heroicon-o-calendar-days and clicking any prefix or suffix affix toggles the calendar. The affixes are bound by the Alpine component rather than through Filament's `focus-input` convention, which needs an Alpine root above the input wrapper that a schema does not guarantee. Date tags. Selected dates render as `fi-badge` tags inside the input, each with its own remove button, on by default for multiple pickers and toggleable with `tags()`. Tags share the input's wrapping row so the field stays one row tall, and the input itself is left empty rather than repeating the dates as a joined string. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Author
|
Opened against the wrong repository by mistake — reopening on my own fork. Sorry for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes four related issues with the non-native Flatpickr field.
Airbnb theme is unreadable in dark mode. The upstream Airbnb theme is light-only (near-black text on white), but
resources/css/index.cssforces a dark surface onto.dark .flatpickr-calendar, so the text stayed dark on dark. A dark palette now lives inresources/css/themes/airbnb.css.Because
bin/build.jsoverwritesresources/dist/themes/fromnode_moduleson every build, hand-editing the dist theme would not survive. The build now appends any matchingresources/css/themes/<theme>.cssto the copied theme, so the mechanism is reusable for the other light-only themes.The first click on a day was swallowed. Clicking a day blurs the input, and the blur handler ran
commitManualInput()→fp.clear()→redraw(). That replaced the day element betweenmousedownandmouseup, so theclicknever landed on a day and the selection needed a second click. Three fixes:mousedowninside the calendar ispreventDefaulted so focus never leaves the input (the year/time inputs and month dropdown are excluded, since they must stay focusable)bluris ignored while the picker is open —onClosealready commitscommitManualInputno longer callsclear()when there is nothing to clearCalendar prefix icon.
prefixIcondefaults toheroicon-o-calendar-days, and clicking any prefix or suffix affix toggles the calendar. Prefix/suffix actions keep their own click behaviour.Selected dates as removable tags. Each date renders as a Filament
fi-badgeinside the input with its own remove button — on by default for multiple pickers,->tags()/->tags(false)to override. Tags share the input's wrapping row so the field stays one row tall, and the input is left empty rather than repeating the dates as a joined comma string.Linked issues
Test plan
composer test— 161 pass (11 new render tests intests/FlatpickrRenderTest.php)composer analyse— no errorsvendor/bin/pint --test— passestheme.css:clear()while open leaves the day element withisConnected: false), then confirmed a single click selects after the fixmousedownguard2026-08-05,2026-08-10; removing all → empty#404848→#e5e7eb, weekdayrgba(0,0,0,.54)→rgba(229,231,235,.6), month/year#3c3f40→#e5e7eb; light mode values unchangedNotes for reviewers
x-on:focus-input.stopconvention (whatTagsInputuses). That convention needs an Alpine root somewhere above the input wrapper, which a schema does not guarantee — it silently did nothing in a bare harness. The component's own element always hasx-data.resources/dist/is committed, so the rebuiltcomponents/flatpickr.js,flatpickr.cssandthemes/airbnb.cssare part of the diff.themes/default.csswas deliberately left alone.light,confettiand thematerial_*themes have the same problem and can reuse the new build hook.🤖 Generated with Claude Code