mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 16:05:23 +02:00
UI: Enable 'Enter' key to apply filters in ColumnFilterPopover. Improved search usability by allowing quick selection and application of filters from the keyboard.
This commit is contained in:
@@ -105,6 +105,7 @@ export function ColumnFilterPopover({
|
||||
setConditionResult(results);
|
||||
onSelectAll(results);
|
||||
setActiveTab('values');
|
||||
onClose();
|
||||
};
|
||||
|
||||
const handleMouseDown = (index: number) => {
|
||||
@@ -201,6 +202,13 @@ export function ColumnFilterPopover({
|
||||
placeholder="Filter values..."
|
||||
value={search}
|
||||
onChange={e => setSearch(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' && search) {
|
||||
e.preventDefault();
|
||||
onSelectAll(filteredValues);
|
||||
onClose();
|
||||
}
|
||||
}}
|
||||
className="w-full bg-slate-900 border border-slate-700 rounded p-1.5 pl-8 pr-7 text-xs text-white focus:outline-none focus:border-blue-500"
|
||||
autoFocus
|
||||
/>
|
||||
@@ -320,6 +328,12 @@ export function ColumnFilterPopover({
|
||||
type="text"
|
||||
value={condition.value}
|
||||
onChange={e => setCondition({ ...condition, value: e.target.value })}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' && condition.value) {
|
||||
e.preventDefault();
|
||||
applyCondition();
|
||||
}
|
||||
}}
|
||||
placeholder="Enter value..."
|
||||
className="w-full mt-1 bg-slate-900 border border-slate-700 rounded p-1.5 text-xs text-white focus:outline-none focus:border-blue-500"
|
||||
/>
|
||||
@@ -332,6 +346,12 @@ export function ColumnFilterPopover({
|
||||
type="text"
|
||||
value={condition.value2 || ''}
|
||||
onChange={e => setCondition({ ...condition, value2: e.target.value })}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' && condition.value && condition.value2) {
|
||||
e.preventDefault();
|
||||
applyCondition();
|
||||
}
|
||||
}}
|
||||
placeholder="Enter second value..."
|
||||
className="w-full mt-1 bg-slate-900 border border-slate-700 rounded p-1.5 text-xs text-white focus:outline-none focus:border-blue-500"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user