Skip to content

fix: prevent native select from showing the wrong dynamic option#19871

Merged
danharrin merged 3 commits into
filamentphp:4.xfrom
People-Sea:fix/issues/19856
May 22, 2026
Merged

fix: prevent native select from showing the wrong dynamic option#19871
danharrin merged 3 commits into
filamentphp:4.xfrom
People-Sea:fix/issues/19856

Conversation

@People-Sea
Copy link
Copy Markdown
Member

@People-Sea People-Sea commented May 17, 2026

Description

Fixes: #19856

Native Select fields with dynamic options() can keep a stale selected option when their option list changes.

This adds a dynamic wire:key to the native select input so it is remounted when the resolved options change.

This does not change the field state when the current value is no longer present in the resolved options. It only prevents the native select from visually selecting a different option after Livewire morphs the option list.

Static option lists keep the existing markup unchanged.

Visual changes

Before

before.mov

After

after.mov

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

@github-project-automation github-project-automation Bot moved this to Todo in Roadmap May 17, 2026
@People-Sea People-Sea marked this pull request as ready for review May 17, 2026 16:31
@danharrin danharrin added bug Something isn't working pending review labels May 20, 2026
@danharrin danharrin added this to the v4 milestone May 20, 2026
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Roadmap May 22, 2026
@danharrin danharrin merged commit e48ddec into filamentphp:4.x May 22, 2026
23 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Roadmap May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Common options in dependant Select can break visual consistency

2 participants