You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is that the event firing order of mousedown and mouseup is before the click event. This can avoid race problems very well.
The core function is implemented by bubbling to document, so if the user acts on the external element of v-onclickaway through the set click event, the trigger time will always be earlier than the trigger of the v-onclickaway callback function. This will cause if the user's click event callback and v-onclickaway callback modify the same state (there is a race problem), then the final result is always the modified result of the v-onclickaway callback (this is not desirable, because v-onclickaway callbacks are usually basic behavior, and the user's click priority should be higher than the basic behavior).
For example, v-onclickaway acts on the dialog to close the dialog. When the dialog external element registers the click event to open the dialog, the dialog will never be opened.
The reason is that the event firing order of mousedown and mouseup is before the click event. This can avoid race problems very well.
The core function is implemented by bubbling to document, so if the user acts on the external element of v-onclickaway through the set click event, the trigger time will always be earlier than the trigger of the v-onclickaway callback function. This will cause if the user's click event callback and v-onclickaway callback modify the same state (there is a race problem), then the final result is always the modified result of the v-onclickaway callback (this is not desirable, because v-onclickaway callbacks are usually basic behavior, and the user's click priority should be higher than the basic behavior).
Please refer to https://github.com/ElemeFE/element/blob/dev/src/utils/clickoutside.js practice
The text was updated successfully, but these errors were encountered: