Corrected preventDefault with mousewheel in PixiJS List.
This commit is contained in:
		
							parent
							
								
									f84d554a69
								
							
						
					
					
						commit
						3ca25b3e93
					
				
							
								
								
									
										2
									
								
								dist/iwmlib.pixi.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/iwmlib.pixi.js
									
									
									
									
										vendored
									
									
								
							| @ -13758,11 +13758,11 @@ | |||||||
|             if (this.opts.app) { |             if (this.opts.app) { | ||||||
|                 const app = this.opts.app; |                 const app = this.opts.app; | ||||||
|                 app.view.addEventListener('mousewheel', event => { |                 app.view.addEventListener('mousewheel', event => { | ||||||
|                     event.preventDefault(); |  | ||||||
|                     const bounds = this.mask ? this.mask.getBounds() : this.getBounds(); |                     const bounds = this.mask ? this.mask.getBounds() : this.getBounds(); | ||||||
|                     const x = event.clientX - app.view.getBoundingClientRect().left; |                     const x = event.clientX - app.view.getBoundingClientRect().left; | ||||||
|                     const y = event.clientY - app.view.getBoundingClientRect().top; |                     const y = event.clientY - app.view.getBoundingClientRect().top; | ||||||
|                     if (bounds.contains(x, y)) { |                     if (bounds.contains(x, y)) { | ||||||
|  |                         event.preventDefault(); | ||||||
|                         this.emit('scroll', event); |                         this.emit('scroll', event); | ||||||
|                     } |                     } | ||||||
|                 }); |                 }); | ||||||
|  | |||||||
| @ -107,11 +107,11 @@ export default class List extends PIXI.Container { | |||||||
|         if (this.opts.app) { |         if (this.opts.app) { | ||||||
|             const app = this.opts.app |             const app = this.opts.app | ||||||
|             app.view.addEventListener('mousewheel', event => { |             app.view.addEventListener('mousewheel', event => { | ||||||
|                 event.preventDefault() |  | ||||||
|                 const bounds = this.mask ? this.mask.getBounds() : this.getBounds() |                 const bounds = this.mask ? this.mask.getBounds() : this.getBounds() | ||||||
|                 const x = event.clientX - app.view.getBoundingClientRect().left |                 const x = event.clientX - app.view.getBoundingClientRect().left | ||||||
|                 const y = event.clientY - app.view.getBoundingClientRect().top |                 const y = event.clientY - app.view.getBoundingClientRect().top | ||||||
|                 if (bounds.contains(x, y)) { |                 if (bounds.contains(x, y)) { | ||||||
|  |                     event.preventDefault() | ||||||
|                     this.emit('scroll', event) |                     this.emit('scroll', event) | ||||||
|                 } |                 } | ||||||
|             }) |             }) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user