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

feat(Select): add clear() method to remove selected value programmatically #770

Merged
merged 3 commits into from
Jan 15, 2024

Conversation

dgonzalezr
Copy link
Collaborator

This will allow users to clear the selection programmatically. E.g:

<bq-select name="options" placeholder="Placeholder" value="2">
  <bq-option value="1" class="hydrated">Option 1</bq-option>
  <bq-option value="2" class="hydrated">Option 2</bq-option>
  <bq-option value="3" class="hydrated">Option 3</bq-option>
  <bq-option value="4" class="hydrated">Option 4</bq-option>
  <bq-option value="5" class="hydrated">Option 5</bq-option>
</bq-select>
const bqSelectElem = document.querySelector('bq-select[name="options"]');
...
await bqSelectElem.clear();

@dgonzalezr dgonzalezr added the feature 🛠 New feature or request label Jan 12, 2024
@dgonzalezr dgonzalezr requested a review from Cata1989 January 12, 2024 17:54
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Collaborator

@Cata1989 Cata1989 left a comment

Choose a reason for hiding this comment

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

LGTM

@dgonzalezr dgonzalezr merged commit 57f84e8 into main Jan 15, 2024
5 checks passed
@dgonzalezr dgonzalezr deleted the feat/select-clear-method branch January 15, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🛠 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants