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

min/max/required` not working for components in concealable component. #14504

Open
MarkKremer opened this issue Oct 11, 2024 · 0 comments
Open
Labels

Comments

@MarkKremer
Copy link

MarkKremer commented Oct 11, 2024

Package

filament/forms

Package Version

v3.2.117

Laravel Version

v11.27.2

Livewire Version

v3.5.6

PHP Version

8.2

Problem description

TextInput (and possibly other components) do not apply a front-end min/max/required attribute when nested in a concealable component, even though the fields are at that moment not concealed.

Expected behavior

Visible form elements have the min/max/required applied so the browser's native form element works as required. For example, when clicking the arrows on a number field with a min value, it will not go below the min value. Other browser validation works too.

Steps to reproduce

  1. Create a TextInput component with a min attribute inside a concealable component. E.g,.
Tabs::make('Heading')
    ->tabs([
        Tabs\Tab::make('User info')
            ->schema([
                TextInput::make('age')
                    ->statePath('age')
                    ->numeric()
                    ->minValue(18),
            ]),
    ]),
  1. See in the browser that it does not have a min attribute applied even through the field is visible.

In the reproduction repository:

  1. Composer install, migrate and seed etc.
  2. Go to http://127.0.0.1:8000/admin/users/1/edit and login.
  3. See that the height field is restricted to a min value of 100 (not nested in a concealable component) and the age field is not even though it does have a min of 18.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/MarkKremer/filament-pr

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant