-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stack timeout listener #23
stack timeout listener #23
Conversation
I really like this approach Huei, it's a neat way to keep track of all events and therefore easily remove them. I think we should move forward in this direction. However one issue I'm just realizing now is that a new popup will still accidentally hide if you go from one preview from one
It seems a new popup (from a different |
yup you are right, every single call of
Will look into that! Thanks. |
As we discuss, we will move this into another ticket, as this requires more changes to the overall codebase. |
src/event.js
Outdated
@@ -1,27 +1,43 @@ | |||
import { isTouch } from './utils' | |||
|
|||
export const customEvents = popup => { | |||
const onMouseLeave = e => { | |||
|
|||
var eventListenerStack = [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let
instead of var
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errr, right i don't know why it happens to var
here, on it
* Add 300 ms delay to onMouseLeve * Handle quick exit and re-enter * Define previewElement at top of the scope * Fix issue when quickly transitioning to a new popup * stack timeout listener (#23) * POC - stack all event listener and timeout event * remove unused comment line * naming clearAllEventListener * var -> let * Fix touch interaction Co-authored-by: Huei Tan <hueitan@users.noreply.github.com>
PR related to #20
Comment related to beb4a3a#commitcomment-40695177
Before we introducing the delay feature for desktop, we deal with all the events synchronously, delay feature brings the race condition and asynchronous event execution. Also note that there is only one instance of popup, unless we declare popup instance for each new popup event.
Therefore this let us think more about the order of the event called, and all of them should be cleared empty once hide event is called, this POC shows the following
Let me know what do you see or foresee any problem.