Skip to content
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

Bug: parent container's event is triggered twice. #429

Open
mathedu4all opened this issue Mar 21, 2023 · 0 comments
Open

Bug: parent container's event is triggered twice. #429

mathedu4all opened this issue Mar 21, 2023 · 0 comments

Comments

@mathedu4all
Copy link

Current Behavior

parent container's event is triggered twice.

Expected Behavior

parent container's event should be triggered once as child.

Steps to Reproduce

import { Container, createRoot, Graphics } from '@pixi/react'
import { Application, ICanvas } from 'pixi.js'
import React from 'react'
import * as PIXI from 'pixi.js'

const container = document.getElementById('container') as unknown as ICanvas
if (container) {
  const app = new Application({
    width: 1080,
    height: 1920,
    view: container,
    antialias: true,
    backgroundColor: 0xf0e1d8
  })
  const root = createRoot(app.stage)
  const draw = (g: PIXI.Graphics) => {
    g.beginFill(0x000000)
    g.drawRect(0, 0, 100, 100)
    g.endFill()
  }
  root.render(
    <Container eventMode={'static'} onpointerdown={() => console.log('down')}>
      <Container eventMode={'static'} onpointerup={() => console.log('up')}>
        <Graphics draw={draw} />
      </Container>
    </Container>
  )
}

Environment

  • @pixi/react version: 7.0.3
  • pixi.js version: 7.2.1
  • React version: 18.2.0
  • ReactDOM version: 18.2.0

Possible Solution

No response

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant