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: ComboBox readonly state fixed #17457

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
fix: removed readonly handler from getmenuprops
  • Loading branch information
Gururajj77 committed Sep 26, 2024
commit d78bdb54244ece9e59b840c0a7d964153aeed71b
7 changes: 0 additions & 7 deletions packages/react/src/components/ComboBox/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,9 @@
}
if (readOnly) {
// Prevent the list from opening if readOnly is true
event.preventDownshiftDefault = true;
event?.persist?.();
return;

Check warning on line 593 in packages/react/src/components/ComboBox/ComboBox.tsx

View check run for this annotation

Codecov / codecov/patch

packages/react/src/components/ComboBox/ComboBox.tsx#L591-L593

Added lines #L591 - L593 were not covered by tests
}

if (event.target === textInput.current && isOpen) {
Expand Down Expand Up @@ -891,13 +891,6 @@
toggleMenu();
}
}
if (readOnly) {
// Prevent default behavior for all keys except Tab when readOnly
if (event.key !== 'Tab') {
event.preventDefault();
}
return;
}
},
})}
{...rest}
Expand Down
Loading