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 remove placeholder search text on readonly field #11419

Open
wants to merge 2 commits into
base: 5
Choose a base branch
from

Conversation

andrewandante
Copy link
Contributor

@andrewandante andrewandante commented Oct 8, 2024

Description

Sets the placeholder text to an empty string on a readonly, "searchable" dropdown.

Also removes a line that sets a $name variable as it is unused in the method

Issues

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • This change is covered with tests (or tests aren't necessary for this change)
  • Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
  • CI is green

@@ -139,7 +139,6 @@ public function getPlaceholder(): string
return $emptyString;
}
}
$name = $this->getName();
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this isn't used below, which I assume is why you've removed it? Please add a note in future when making changes like this so it's easier to know what's going on.

It's obvious in your IDE because it presumably gets greyed out, but seeing why a change like this was made in a git diff requires more double checking.

@@ -598,6 +597,9 @@ public function performReadonlyTransformation()
$field->setSource($this->sourceList);
$field->setReadonly(true);

// Remove the text "Type to search..." on a read-only field
$this->setUseDynamicPlaceholder(false);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$this->setUseDynamicPlaceholder(false);
$field->setUseDynamicPlaceholder(false);

Shouldn't this be called on the field we're returning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it should. I suspect it won't work because we are now using a different field type, so I'm going to keep playing with this 'til my test passes 🤔

@andrewandante andrewandante force-pushed the FIX_disabled_search_dropdown_placeholder branch from 30049dd to b5203fd Compare October 10, 2024 02:02
@GuySartorelli
Copy link
Member

@andrewandante Let me know when this is ready to review and I'll take another look

@andrewandante
Copy link
Contributor Author

Thanks - I asked for reproduction steps in the attached issue, I suspect this may also be coming from the React component actually.

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