mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-17 21:00:45 +00:00
CE-798 follow-up - Prevent tab in date/date-time filter value input boxes from closing a quick-filter menu (via an onKeyDown handler)
This commit is contained in:
@ -94,6 +94,24 @@ export const makeTextField = (field: QFieldMetaData, criteria: QFilterCriteriaWi
|
|||||||
document.getElementById(`${idPrefix}${criteria.id}`).focus();
|
document.getElementById(`${idPrefix}${criteria.id}`).focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Event handler for key-down events - specifically added here, to stop pressing
|
||||||
|
** 'tab' in a date or date-time from closing the quick-filter...
|
||||||
|
*******************************************************************************/
|
||||||
|
const handleKeyDown = (e: any) =>
|
||||||
|
{
|
||||||
|
if (field.type == QFieldType.DATE || field.type == QFieldType.DATE_TIME)
|
||||||
|
{
|
||||||
|
if(e.code == "Tab")
|
||||||
|
{
|
||||||
|
console.log("Tab on date or date-time - don't close me, just move to the next sub-field!...");
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const inputProps: any = {};
|
const inputProps: any = {};
|
||||||
inputProps.endAdornment = (
|
inputProps.endAdornment = (
|
||||||
<InputAdornment position="end">
|
<InputAdornment position="end">
|
||||||
@ -110,6 +128,7 @@ export const makeTextField = (field: QFieldMetaData, criteria: QFilterCriteriaWi
|
|||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
type={type}
|
type={type}
|
||||||
onChange={(event) => valueChangeHandler(event, valueIndex)}
|
onChange={(event) => valueChangeHandler(event, valueIndex)}
|
||||||
|
onKeyDown={handleKeyDown}
|
||||||
value={value}
|
value={value}
|
||||||
InputLabelProps={inputLabelProps}
|
InputLabelProps={inputLabelProps}
|
||||||
InputProps={inputProps}
|
InputProps={inputProps}
|
||||||
|
Reference in New Issue
Block a user