mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 12:35:25 +02:00
feat: allow applying filters with Enter key
This commit is contained in:
@@ -245,9 +245,11 @@ export function ColumnFilterPopover({
|
|||||||
value={search}
|
value={search}
|
||||||
onChange={e => setSearch(e.target.value)}
|
onChange={e => setSearch(e.target.value)}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === 'Enter' && search) {
|
if (e.key === 'Enter') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (search) {
|
||||||
onSelectAll(filteredValues);
|
onSelectAll(filteredValues);
|
||||||
|
}
|
||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -371,7 +373,7 @@ export function ColumnFilterPopover({
|
|||||||
value={condition.value}
|
value={condition.value}
|
||||||
onChange={e => setCondition({ ...condition, value: e.target.value })}
|
onChange={e => setCondition({ ...condition, value: e.target.value })}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === 'Enter' && condition.value) {
|
if (e.key === 'Enter') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
applyCondition();
|
applyCondition();
|
||||||
}
|
}
|
||||||
@@ -389,7 +391,7 @@ export function ColumnFilterPopover({
|
|||||||
value={condition.value2 || ''}
|
value={condition.value2 || ''}
|
||||||
onChange={e => setCondition({ ...condition, value2: e.target.value })}
|
onChange={e => setCondition({ ...condition, value2: e.target.value })}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === 'Enter' && condition.value && condition.value2) {
|
if (e.key === 'Enter') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
applyCondition();
|
applyCondition();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2086,6 +2086,7 @@ function TextFilterPopover({ value, onChange, onClose, triggerId }: {
|
|||||||
placeholder={`Term ${idx + 1}...`}
|
placeholder={`Term ${idx + 1}...`}
|
||||||
value={term}
|
value={term}
|
||||||
onChange={e => updateTerm(idx, e.target.value)}
|
onChange={e => updateTerm(idx, e.target.value)}
|
||||||
|
onKeyDown={e => e.key === 'Enter' && onClose()}
|
||||||
autoFocus={idx === value.terms.length - 1}
|
autoFocus={idx === value.terms.length - 1}
|
||||||
className="w-full bg-slate-900 border border-slate-700 rounded-md p-2 pl-8 pr-8 text-xs text-white focus:outline-none focus:border-blue-500 transition-all"
|
className="w-full bg-slate-900 border border-slate-700 rounded-md p-2 pl-8 pr-8 text-xs text-white focus:outline-none focus:border-blue-500 transition-all"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user