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

Esc key closes the create patient popup #2937

Merged
merged 1 commit into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Components/Assets/AssetsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ const AssetsList = () => {
errors=""
/>
</div>
<div className="flex-1 flex flex-col justify-start items-end">
<div className="flex flex-row justify-start items-center gap-2">
<AdvancedFilterButton setShowFilters={setShowFilters} />
<button
className="btn btn-primary"
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Common/AdvancedFilterButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
const AdvancedFilterButton = ({ setShowFilters }: any) => {
return (
<div>
<div className="flex items-start mb-2">
<div className="flex items-start">
<button
className="btn btn-primary-ghost"
onClick={() => setShowFilters(true)}
Expand Down
10 changes: 9 additions & 1 deletion src/Components/ExternalResult/FacilitiesSelectDialogue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,20 @@ const styles = {
const FacilitiesSelectDialog = (props: Props & WithStyles<typeof styles>) => {
const { handleOk, handleCancel, classes, selectedFacility, setSelected } =
props;

const handleEscKeyPress = (event: any) => {
if (event.key === "Escape") {
handleCancel();
}
};

return (
<Dialog
open={true}
classes={{
paper: classes.paper,
}}
onKeyDown={(e) => handleEscKeyPress(e)}
>
<DialogTitle
className=" font-semibold text-3xl"
Expand All @@ -57,7 +65,7 @@ const FacilitiesSelectDialog = (props: Props & WithStyles<typeof styles>) => {
color="secondary"
onClick={() => handleCancel()}
>
Cancel Creation
Cancel
</Button>
<Button
onClick={handleOk}
Expand Down