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

Prevented tab propagation from Dialogs #144

Merged
merged 1 commit into from
Nov 27, 2024
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 library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@irontec/ivoz-ui",
"version": "1.7.0",
"version": "1.7.1",
"description": "UI library used in ivozprovider",
"license": "GPL-3.0",
"main": "index.js",
Expand Down
7 changes: 7 additions & 0 deletions library/src/components/shared/ConfirmDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export default function ConfirmDialog(props: ConfirmDialogProps): JSX.Element {
[]
);

const handleKeyDown = (event: React.KeyboardEvent) => {
if (event.key === 'Tab') {
event.stopPropagation();
}
};

const sumbitEnabled = !doubleCheck || inputVal == doubleCheckExpectedStr;

return (
Expand All @@ -63,6 +69,7 @@ export default function ConfirmDialog(props: ConfirmDialogProps): JSX.Element {
onClose={handleClose}
aria-labelledby='alert-dialog-slide-title'
aria-describedby='alert-dialog-slide-description'
onKeyDown={handleKeyDown}
>
<CloseRoundedIcon className='close-icon' onClick={handleClose} />
<img src='assets/img/delete-dialog.svg' className='modal-icon' />
Expand Down
7 changes: 7 additions & 0 deletions library/src/components/shared/ConfirmEditDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export const ConfirmEditionDialog = (props: ConfirmEditDialogProps) => {
const TOTAL_TIME = 100;
const [progress, setProgress] = useState(TOTAL_TIME);

const handleKeyDown = (event: React.KeyboardEvent) => {
if (event.key === 'Tab') {
event.stopPropagation();
}
};

useEffect(() => {
let timer: NodeJS.Timeout | null = null;
if (open) {
Expand Down Expand Up @@ -64,6 +70,7 @@ export const ConfirmEditionDialog = (props: ConfirmEditDialogProps) => {
TransitionComponent={Transition}
keepMounted
onClose={handleClose}
onKeyDown={handleKeyDown}
aria-labelledby='alert-dialog-slide-title'
aria-describedby='alert-dialog-slide-description'
>
Expand Down
Loading