fix: handle keyboard shortcut for text filter#594
fix: handle keyboard shortcut for text filter#594nicolethoen merged 2 commits intopatternfly:mainfrom
Conversation
nicolethoen
left a comment
There was a problem hiding this comment.
since this component attaches a window-level event listener, consuming applications don't currently have a way to opt out of this behavior.
This could be problematic in scenarios where:
- The application wants to manage keyboard shortcuts at a higher level (e.g.,
in a centralized keyboard handler) - Multiple
DataViewTextFilterinstances exist on the same page, causing
multiple listeners to fire - The
/shortcut conflicts with existing application shortcuts
Could we consider an optional prop in case they want more fine tuned control over this feature?
export interface DataViewTextFilterProps extends SearchInputProps {
// ... existing props
/** Enable keyboard shortcut (/) to focus the filter. Defaults to true. */
enableShortcut?: boolean;
}|
🎉 This PR is included in version 6.4.0-prerelease.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
Thanks for the enhacement! This works as expected. However, I fear discoverability is nil. In OpenShift console, we used to include a badge in the input with a shortcut hint. I think we'll want something similar here so users know what the shortcut is. GitHub has similar functionality. Screen.Recording.2026-03-16.at.10.22.43.AM.movCan we add something similar? |
|
Hmm. It occurs to me we can and probably should use our existing TextFilter instead of |
|
Handle keyboard shortcut for text filter
/will focus the text filterOCPBUGS-63391