refactor(docs-infra): replace `mousewheel` event with `wheel` event (#32980)
This commit replaces the non-standard, depecated [mousewheel][1] event (which is not supported in Firefox and possibly other browsers too) with the standard [wheel][2] event, which works on all supported browsers according to [MDN's compatibility table][3]. I manually tested it in Chrome, Firefox, Edge and IE11. [1]: https://developer.mozilla.org/en-US/docs/Web/API/Element/mousewheel_event [2]: https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event [3]: https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event#Browser_compatibility PR Close #32980
This commit is contained in:
parent
be54c580bf
commit
4e1f37fc17
|
@ -57,7 +57,7 @@
|
|||
|
||||
</mat-sidenav-container>
|
||||
|
||||
<div *ngIf="hasFloatingToc" class="toc-container no-print" [style.max-height.px]="tocMaxHeight" (mousewheel)="restrainScrolling($event)">
|
||||
<div *ngIf="hasFloatingToc" class="toc-container no-print" [style.max-height.px]="tocMaxHeight" (wheel)="restrainScrolling($event)">
|
||||
<aio-lazy-ce selector="aio-toc"></aio-lazy-ce>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -667,7 +667,7 @@ describe('AppComponent', () => {
|
|||
|
||||
it('should restrain scrolling inside the ToC container', () => {
|
||||
const restrainScrolling = spyOn(component, 'restrainScrolling');
|
||||
const evt = new MouseEvent('mousewheel');
|
||||
const evt = new WheelEvent('wheel');
|
||||
|
||||
setHasFloatingToc(true);
|
||||
expect(restrainScrolling).not.toHaveBeenCalled();
|
||||
|
|
Loading…
Reference in New Issue