Fix: Cross button not resetting timeout to inherit (#5749)

* Fix: Cross button not resetting timeout to inherit
This commit is contained in:
Pooja
2025-10-09 14:47:18 +05:30
committed by GitHub
parent 944674d208
commit c2d40fe99f
4 changed files with 27 additions and 13 deletions

View File

@@ -68,12 +68,12 @@ const Settings = ({ item, collection }) => {
const handleTimeoutDropdownSelect = useCallback((option) => {
if (option === 'inherit') {
onTimeoutChange({ target: { value: 'inherit' } });
updateSetting({ timeout: 'inherit' });
} else if (option === 'custom') {
// Switch to custom value - start with 0
onTimeoutChange({ target: { value: 0 } });
updateSetting({ timeout: 0 });
}
}, [onTimeoutChange]);
}, [updateSetting]);
// Keyboard shortcut handlers
const onSave = useCallback(() => {
@@ -148,7 +148,7 @@ const Settings = ({ item, collection }) => {
isInherited={isTimeoutInherited}
onDropdownSelect={handleTimeoutDropdownSelect}
onValueChange={(e) => !isTimeoutInherited && onTimeoutChange(e)}
onCustomValueReset={() => onTimeoutChange({ target: { value: 'inherit' } })}
onCustomValueReset={() => updateSetting({ timeout: 'inherit' })}
/>
</div>
</div>