Skip to content

fix: select combo box input text on next click after dropdown closed#11324

Merged
web-padawan merged 5 commits into
mainfrom
fix-select-input-text-on-next-click-after-dropdown-closed
Mar 12, 2026
Merged

fix: select combo box input text on next click after dropdown closed#11324
web-padawan merged 5 commits into
mainfrom
fix-select-input-text-on-next-click-after-dropdown-closed

Conversation

@ugur-vaadin
Copy link
Copy Markdown
Contributor

@ugur-vaadin ugur-vaadin commented Mar 11, 2026

Description

Outside click on combo box does not make it lose focus. However, since the selection of input text happens on focus (see input-control-mixin), this prevents autoselect from selecting the input text on click again. This PR makes the combo box select the input text on click once after dropdown closed if the combo box is autoselect.

Fixes #11188

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/pr
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Comment thread packages/combo-box/src/vaadin-combo-box-base-mixin.js Outdated
Comment thread packages/combo-box/src/vaadin-combo-box-base-mixin.js
@ugur-vaadin ugur-vaadin force-pushed the fix-select-input-text-on-next-click-after-dropdown-closed branch from 093017c to f1b2a6f Compare March 12, 2026 08:07
@ugur-vaadin
Copy link
Copy Markdown
Contributor Author

Updated the PR to handle the case where user selects text manually after outside click. Now, before selecting the text on click, we check if the input text is already selected (partially or fully). If there is a selection, the autoselect does not lead to selecting the whole text in order to avoid interfering with the user's intent.

@sonarqubecloud
Copy link
Copy Markdown

@web-padawan web-padawan removed the request for review from DiegoCardoso March 12, 2026 14:38
@web-padawan web-padawan merged commit 0089e08 into main Mar 12, 2026
10 checks passed
@web-padawan web-padawan deleted the fix-select-input-text-on-next-click-after-dropdown-closed branch March 12, 2026 14:39
@vaadin-bot
Copy link
Copy Markdown
Collaborator

Hi @ugur-vaadin and @web-padawan, when i performed cherry-pick to this commit to 24.10, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 0089e08
error: could not apply 0089e08... fix: select combo box input text on next click after dropdown closed (#11324)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot
Copy link
Copy Markdown
Collaborator

Hi @ugur-vaadin and @web-padawan, when i performed cherry-pick to this commit to 24.9, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 0089e08
error: could not apply 0089e08... fix: select combo box input text on next click after dropdown closed (#11324)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

web-padawan pushed a commit that referenced this pull request Mar 12, 2026
…11324) (#11350)

Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
web-padawan pushed a commit that referenced this pull request Mar 12, 2026
…11324) (#11351)

Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[combo-box] Autoselect attribute does not work correctly in vaadin-combo-box

4 participants