Skip to content

Commit 7ee52ae

Browse files
committed
Refactor fireChangeEvent to be Synchronous and Review Event Handler Timing #7129
1 parent c6d1c70 commit 7ee52ae

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

examples/grid/bigData/ControlsContainer.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ import TabContainer from '../../../src/tab/Container.mjs';
99
* @extends Neo.container.Base
1010
*/
1111
class ControlsContainer extends Container {
12+
/**
13+
* We need to add a 1-frame delay here. Rationale: the change events trigger huge computational logic.
14+
* We need to ensure that a ComboBox list selection first updates the field input value node,
15+
* and then continues with the grid update, to maintain a great UX.
16+
* @member {Object} delayable
17+
* @static
18+
*/
19+
static delayable = {
20+
onAmountColumnsChange : {type: 'buffer', timer: 30},
21+
onAmountRowsChange : {type: 'buffer', timer: 30},
22+
onBufferColumnRangeChange: {type: 'buffer', timer: 30},
23+
onBufferRowRangeChange : {type: 'buffer', timer: 30}
24+
}
25+
1226
static config = {
1327
/**
1428
* @member {String} className='Neo.examples.grid.bigData.ControlsContainer'

src/form/field/ComboBox.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,11 @@ class ComboBox extends Picker {
452452
* @param {*} oldValue
453453
* @override
454454
*/
455-
async fireChangeEvent(value, oldValue) {
455+
fireChangeEvent(value, oldValue) {
456456
let me = this,
457457
FormContainer = Neo.form?.Container,
458458
params = {component: me, oldValue, value};
459459

460-
await me.timeout(30);
461-
462460
me.fire('change', params);
463461

464462
if (!me.suspendEvents) {

0 commit comments

Comments
 (0)