Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added method to add an empty option to select form field #2581

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

zeezo887
Copy link
Collaborator

@zeezo887 zeezo887 commented May 6, 2024

Description

Allows adding an empty option as the first item of a select field options

Select::make()
  ->name('field')
  ->options(
      Options::make([
          Option::make('value', 'label'),
          Option::make('value2', 'label2'),
      ])
  )->withEmptyOption()
  ->required()

Related Issues

Fixes #2562

@Tofandel
Copy link
Contributor

I think clearable makes more sense, then we could show a clear button on the select input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't unselect option from Select (form field)
2 participants