Skip to content

[Bug]: SelectTree can be cleared with backspace even when configured to be not-clearable #210

@gp-lnuff

Description

@gp-lnuff

What happened?

When using the ->clearable(false) configuration method,
while the button to clear the option does not appear,
the user is easily able to press backspace to clear the selected option.
This creates situations where a field that is not supposed to ever be nullable (as expected by the $get utility, for example) can become null and break form reactivity.

How to reproduce the bug

  • Add any SelectTree to any Schema
  • configure it as ->clearable(false)
  • focus the SelectTree and press backspace

Package Version

4.1.0

PHP Version

8.5.3

Laravel Version

13.6.0

Which operating systems does with happen with?

Windows

Notes

The bug has likely existed for a long time, I only noticed it because I tried to make a SelectTree searchable and I was able to "delete" the state as though it were part of the search. By further testing I determined that this happens regardless of the search functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions