Ensure that the search filter should be cleared when a new row is added to the user management. #5261

This commit is contained in:
Akshay Joshi
2022-09-23 15:04:30 +05:30
parent f64b572150
commit bc08512327
2 changed files with 8 additions and 3 deletions

View File

@@ -246,7 +246,11 @@ export function DataGridHeader({label, canAdd, onAddClick, canSearch, onSearchTe
</Box>
}
<Box className={classes.gridControls}>
{canAdd && <PgIconButton data-test="add-row" title={gettext('Add row')} onClick={onAddClick} icon={<AddIcon />} className={classes.gridControlsButton} />}
{canAdd && <PgIconButton data-test="add-row" title={gettext('Add row')} onClick={()=>{
setSearchText('');
onSearchTextChange('');
onAddClick();
}} icon={<AddIcon />} className={classes.gridControlsButton} />}
</Box>
</Box>
);