1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-12 16:48:10 +00:00

core/GUI: save whole element ids in required keys

This commit is contained in:
Sotiri Bakagiannis 2021-02-19 14:27:21 +00:00
parent 004a5c96ec
commit 79461914bc

View File

@ -161,7 +161,7 @@ export class GUI
// if the field is required: // if the field is required:
if (key.slice(-1) === '*') if (key.slice(-1) === '*')
{ {
self._requiredKeys.push(key); self._requiredKeys.push(keyId);
} }
// if value is an array, we create a select drop-down menu: // if value is an array, we create a select drop-down menu:
@ -219,9 +219,8 @@ export class GUI
// setup change event handlers for all required keys: // setup change event handlers for all required keys:
Object.keys(this._requiredKeys).forEach((key, keyIdx) => this._requiredKeys.forEach((keyId) =>
{ {
const keyId = 'form-input-' + keyIdx;
const input = document.getElementById(keyId); const input = document.getElementById(keyId);
if (input) if (input)
{ {