mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-29 04:38:55 +03:00
Fix edit shortcuts with checkbox
This commit is contained in:
parent
1f4d4dfea7
commit
b2f9dd010e
1 changed files with 6 additions and 2 deletions
|
@ -471,10 +471,14 @@ function ShortcutForm({
|
|||
if (editMode && currentType && TYPE_PARAMS[currentType]) {
|
||||
// Populate form
|
||||
const form = formRef.current;
|
||||
TYPE_PARAMS[currentType].forEach(({ name }) => {
|
||||
TYPE_PARAMS[currentType].forEach(({ name, type }) => {
|
||||
const input = form.querySelector(`[name="${name}"]`);
|
||||
if (input && shortcut[name]) {
|
||||
input.value = shortcut[name];
|
||||
if (type === 'checkbox') {
|
||||
input.checked = shortcut[name] === 'on' ? true : false;
|
||||
} else {
|
||||
input.value = shortcut[name];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue