-
-
Notifications
You must be signed in to change notification settings - Fork 5
fix: remove passive:true from event listener patch #98
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
fix: remove passive:true from event listener patch #98
Conversation
HIG-2927 [bug] Highlight causes errors with preventDefault
On Fri, Oct 07, 2022 at 1:26 PM, Rakesh Goyal <[email protected]> wrote:
|
Vadman97
left a comment
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.
wow, awesome!
passive - A boolean value that, if true, indicates that the function specified by listener will never call preventDefault(). If a passive listener does call preventDefault(), the user agent will do nothing other than generate a console warning. If not specified, defaults to false – except that in browsers other than Safari and Internet Explorer, defaults to true for the wheel, mousewheel, touchstart and touchmove events. See Improving scrolling performance with passive listeners to learn more.
why is this only a problem in angular? does rrweb somehow wrap the rest of the event listeners that other folks could be adding in their web app, causing them to not be able to call preventDefault? any other possible implications of doing this in other apps?
|
The reason for this seems to be that Angular has its own listener for drag/pointermove events with preventDefault inside, which rrweb tries to wrap with these handlers. |
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.
Removes the `passive:true` option which breaks `preventDefault` for drag and drop in angular. To reproduce, 1. Clone the angular example repo: ```shell git clone [email protected]:aptlin/angular-scratchpad.git rakesh ``` 2. Add ` "dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",` to `scripts` and `rakesh` to `workspaces` in the highlight package.json 3. Run `yarn dev:rakesh` with and without this change.

Removes the
passive:trueoption which breakspreventDefaultfor drag and drop in angular.To reproduce,
"dev:rakesh": "yarn turbo run dev --filter rakesh... --filter frontend...",toscriptsandrakeshtoworkspacesin the highlight package.jsonyarn dev:rakeshwith and without this change.