Open kurokobo opened 2 hours ago
The issue with the variable picker closing after 200 milliseconds when the mouse button is held down is due to the onClick
event handler in the VariablePickerMenuItem
component. This handler calls the selectOptionAndCleanUp
function, which closes the menu immediately upon clicking. Additionally, there is a debounce mechanism in the LexicalTypeaheadMenuPlugin
component, which has a default debounce time of 200 ms for its triggerFn
[1].
To address this issue, you might need to adjust the onClick
handler or the debounce mechanism to ensure that the variable picker remains open long enough for the variable to be inserted when the mouse button is released.
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
0.8.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
/
or{
, or click{x}
button✔️ Expected Behavior
When the mouse button is released, the selected variable is inserted.
❌ Actual Behavior
The variable picker is closed after 200 ms and the variable is not inserted when the mouse button is released.
The capture contains three slow clicks that take more than 200 ms (which failed to insert variables) and three fast clicks (which succeeded in inserting variables).
Additional information
This has also been reported on Discord (I helped with the reporting as well).