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

TouchStart not dispatched through shadow root (?) #19

Open
IanBellomy opened this issue Dec 29, 2018 · 0 comments
Open

TouchStart not dispatched through shadow root (?) #19

IanBellomy opened this issue Dec 29, 2018 · 0 comments

Comments

@IanBellomy
Copy link

IanBellomy commented Dec 29, 2018

This may be related to: #2

TouchEmulator();

class Block extends HTMLElement{

    constructor(){
        super()				
    }				

    connectedCallback(){ 
        const shadowRoot = this.attachShadow({mode: 'open'});		 	
        let $div = document.createElement("div")			  	
            $div.style.width = "100px"
            $div.style.height = "100px"
            $div.style.backgroundColor = "red"

        shadowRoot.append($div)	  	

        this.addEventListener("touchstart",(e)=>{
            console.log("touch my-block")
        })

        $div.addEventListener("touchstart",(e)=>{
            // This handler is not called if TouchEmulator() has been called. 
            // This is only broken if attached to a shadowRoot instead of the actual element. 
            console.log("touch my-block div")
        })
    }
}
customElements.define('my-block',Block)
@IanBellomy IanBellomy changed the title TouchStart not dispatched to shadow children TouchStart not dispatched through shadow root Dec 29, 2018
@IanBellomy IanBellomy changed the title TouchStart not dispatched through shadow root TouchStart not dispatched through shadow root (?) Dec 29, 2018
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