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) O3-2158: Clear order basket search input and trap focus when search gets reset. #1322

Merged
merged 7 commits into from
Aug 21, 2023

Conversation

NYESIGA
Copy link
Contributor

@NYESIGA NYESIGA commented Aug 20, 2023

fix)O3-2158:Clear order basket search input and trap focus when search gets reset. i Declare a ref in the Drug Search component that tracks the Search input using the useRef hook and passed it down in Drug Search Result component and Update the logic in it to to accept the ref as a prop. Create a boolean state variable in the OrderBasketSearchResults component that tracks whether the search input was cleared and set to false and create function onClick handler's logic so that it sets the value of the state variable i created above to true. and i added useEffect hook in OrderBasketSearchResults component that traps focus to the Search input if the boolean state variable is true. After trapping focus, it set the state variable back to false.

244932896-ad73d280-6a3c-4767-9e6c-1e05f57c6ee6.mp4

https://issues.openmrs.org/browse/O3-2158

@NYESIGA
Copy link
Contributor Author

NYESIGA commented Aug 20, 2023

@mks-d mks-d changed the title (fix) 03 2158:clear order besket search input and trap focus when search gets reset (fix) O3-2158: Clear order basket search input and trap focus when search gets reset. Aug 21, 2023
@vasharma05 vasharma05 merged commit 7242935 into openmrs:main Aug 21, 2023
5 of 6 checks passed
AlexanderMizgirev pushed a commit to openmrs-sh/openmrs-esm-patient-chart that referenced this pull request Aug 31, 2023
…arch gets reset. (openmrs#1322)

* (fix) 03-2158:clear order basket search input and trap focus when search gets reset

* (fix) 03-2158:clear order basket search input and trap focus when search get reset

* Update drug-search.component.tsx

* Update drug-search.component.tsx

* Update order-basket-search-results.component.tsx

* Update drug-search.resource.tsx

* Update order-basket-search-results.component.tsx

---------

Co-authored-by: Vineet Sharma <sharmava05@gmail.com>
@NYESIGA NYESIGA deleted the 03-2158 branch November 21, 2023 12:49
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