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

FIX Use correct argument for FormBuilder context #1786

Conversation

emteknetnz
Copy link
Member

Issue #1778

@emteknetnz emteknetnz force-pushed the pulls/2.2/elemental-dropdown branch from 379053d to a11d448 Compare June 19, 2024 22:42
@GuySartorelli
Copy link
Member

I can't de-select a record from the single SearchableDropdownField in an elemental block anymore.
I can select a new record, but not deselect one that was already saved into the field.

@emteknetnz
Copy link
Member Author

emteknetnz commented Jun 20, 2024

I think this might just a be bad default when lazy-loading

Things are "clearable" by default when not lazy-loading because there's a default blank option that's selectable. This option is not there however when you lazy-load. I can solve this by setting ->setIsClearable(true) alongside ->setIsLazyLoaded(true) then I can clear the value.

I think the solution here is that we just update the field to be clearable by default? This won't be a breaking change, just a behavioural change we could ship in 5.3

Note that clicking the little 'x' when it's clearable will clear ALL selected options for the mutli version of the field, though this seems like it's still a good default to me

I'll make a new issue for this

@emteknetnz
Copy link
Member Author

New issue to ensure field is always clearable #1791

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GuySartorelli GuySartorelli merged commit 09ebc84 into silverstripe:2.2 Jun 21, 2024
12 checks passed
@GuySartorelli GuySartorelli deleted the pulls/2.2/elemental-dropdown branch June 21, 2024 03:03
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.

2 participants