Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

fix(search): set focus back to input when search is cleared #675

Merged

Conversation

annawen1
Copy link
Member

@annawen1 annawen1 commented Jul 27, 2021

Related Ticket(s)

Web component: Dotcom shell - Locale modal- After giving the search input and activation of clear search input button the dialog is getting closed #6078

Description

The Carbon for IBM.com Locale Modal extends the carbon-web-components search component. An accessibility issue was reported when search clear button is clicked, the focus doesn't return back to the input. This PR sets the focus back to input when clear input button is clicked.

The Carbon React and Angular instances of search have the same behavior where focus returns to input:
https://react.carbondesignsystem.com/?path=/story/components-search--default
https://angular.carbondesignsystem.com/?path=/story/components-search--basic

Changelog

Changed

  • set focus back to input when handleClearInputButtonClick() is triggered

@ibmdotcom-bot
Copy link
Contributor

@ibmdotcom-bot
Copy link
Contributor

@ibmdotcom-bot
Copy link
Contributor

@ibmdotcom-bot
Copy link
Contributor

Copy link
Member

@ariellalgilmore ariellalgilmore left a comment

Choose a reason for hiding this comment

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

Thanks @annawen1!!

@annawen1 annawen1 added the Ready to merge Label for the pull requests that are ready to merge label Jul 28, 2021
@kodiakhq kodiakhq bot merged commit 3f71051 into carbon-design-system:master Jul 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ready to merge Label for the pull requests that are ready to merge
Projects
None yet
3 participants