@trustquery/browser 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1529,6 +1529,16 @@ class DropdownManager {
1529
1529
  console.log('[DropdownManager] Dropdown option selected:', option, 'for:', matchData.text);
1530
1530
  }
1531
1531
 
1532
+ // IMPORTANT: Trigger callback FIRST, before input event dispatch
1533
+ // The input event triggers a synchronous re-render that removes the dropdown,
1534
+ // so the callback must run while everything is still intact
1535
+ if (this.options.onWordClick) {
1536
+ this.options.onWordClick({
1537
+ ...matchData,
1538
+ selectedOption: option
1539
+ });
1540
+ }
1541
+
1532
1542
  // Check if option has on-select.display
1533
1543
  if (option['on-select'] && option['on-select'].display && this.options.textarea) {
1534
1544
  const displayText = option['on-select'].display;
@@ -1558,14 +1568,6 @@ class DropdownManager {
1558
1568
  }
1559
1569
  }
1560
1570
  }
1561
-
1562
- // Trigger callback
1563
- if (this.options.onWordClick) {
1564
- this.options.onWordClick({
1565
- ...matchData,
1566
- selectedOption: option
1567
- });
1568
- }
1569
1571
  }
1570
1572
 
1571
1573
  /**