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

disabled searchable dropdown shows "Type to search..." where the field is disabled #11398

Open
2 tasks done
sunnysideup opened this issue Sep 23, 2024 · 1 comment
Open
2 tasks done
Labels

Comments

@sunnysideup
Copy link
Contributor

sunnysideup commented Sep 23, 2024

Module version(s) affected

5-x.dev

Description

For a disabled dropdown that contains enough records to be "searchable", the field shows Type to search ... where you clearly can not search:

image

How to reproduce

As above. Basically create a dropdown for a list with MANY entries and the above will happen.

Possible Solution

When setting to readonly (setReadonly method), we should remove that phrase. We should also check if the search is not longer available as this would be a security risk (i.e. you can search all members, where the intention may have been to not show all the members by making it readonly).

Additional Context

No response

Validations

PRs

@andrewandante
Copy link
Contributor

andrewandante commented Oct 15, 2024

Hi @sunnysideup I'm actually having trouble reproducing this, mine keep defaulting to (none) - can you please add some specific reproduction steps?

For reference, I'm doing:

        public function getCMSFields()
        {
            $fields = parent::getCMSFields();

            $fields->addFieldToTab(
                'Root.Main',
                SearchableDropdownField::create(
                    'Thing',
                    'Thing',
                    SiteTree::get()
                )
                ->setIsLazyLoaded(true)
                ->performReadonlyTransformation()
            );

            return $fields;
        }

on a clean install

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

No branches or pull requests

3 participants