From 9023e8e5b865580d40711b6fd9216a9961f8e627 Mon Sep 17 00:00:00 2001 From: Prachi24599 Date: Sat, 14 Nov 2026 23:52:51 +0100 Subject: [PATCH] fix: update current input after click --- src/components/block/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/block/index.ts b/src/components/block/index.ts index 01883731c..44cd08d08 100644 --- a/src/components/block/index.ts +++ b/src/components/block/index.ts @@ -248,6 +248,7 @@ export default class Block extends EventsDispatcher { * Bind synchronously so deferred initialization cannot rebind after destroy. */ this.holder.addEventListener('change', this.handleSelectChange); + this.holder.addEventListener('click', this.handleClick); /** * Bind block events in RIC for optimizing of constructing process time @@ -687,6 +688,7 @@ export default class Block extends EventsDispatcher { */ public destroy(): void { this.holder.removeEventListener('change', this.handleSelectChange); + this.holder.removeEventListener('click', this.handleClick); this.unwatchBlockMutations(); this.removeInputEvents(); @@ -836,7 +838,14 @@ export default class Block extends EventsDispatcher { */ this.updateCurrentInput(); }; - + + /** + * Update current input after the browser has moved the selection. + */ + private handleClick = (): void => { + this.dropInputsCache(); + this.updateCurrentInput(); + }; /** * Handles change events from native select elements. *