Fix date picker crashing when used with clearable#2591
Merged
joshhanley merged 1 commit intomainfrom Apr 23, 2026
Merged
Conversation
Declare `iconVariant` and `size` as props on the four input action sub-components (`clearable`, `viewable`, `copyable`, `expandable`) so they render cleanly when used standalone — e.g. by `flux:date-picker.input`, which calls `flux:input.clearable` directly without passing `iconVariant`.
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.
The Scenario
Rendering a
flux:date-pickerwith a clearable trigger throws:Any code that renders
flux:input.clearable,flux:input.viewable,flux:input.copyable, orflux:input.expandabledirectly (rather than via aflux:input) hits the same error.The Problem
#2566 switched the four input action sub-components from hard-coded icon variants (
variant="micro"/variant="mini") to:variant="$iconVariant", and updatedflux:inputto forward:$iconVariantinto each one.Because
flux:inputalways passesiconVariantdown, the sub-components receive it as a variable and render fine in that path. But the sub-components themselves never declarediconVariantin@props— so they only work when a parent explicitly passes it.flux:date-picker.input's native variant renders the clear button via:iconVariantisn't passed, isn't declared, isn't defined, and rendering blows up.The Solution
Declare
iconVariant(andsize, for the same reason) as props with sensible defaults on each of the four sub-components:minimatches the default onflux:input, so behaviour is unchanged when the sub-components are used viaflux:input. Anywhere they're used standalone —flux:date-picker.inputinternally, or user code calling them directly — now falls through to the default and renders cleanly.sizehad to be declared alongsideiconVariantbecause once@propsis present, Blade stops auto-exposing undeclared attributes as variables, which broke the existing$size === 'sm'checks.Fixes #2590