New issue
Advanced search Search tips

Issue 818323 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Feature



Sign in to add a comment

Feature Request: selectionchange event on Shadow Root

Reported by xenx...@gmail.com, Mar 2 2018

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce the problem:
1. Create a custom element with an attached shadow root 
2. Attach an event listener to listen to the selectionchange event from the shadow root
3. Add that element to the DOM.

Simple code to reproduce:

customElements.define("test-element", class extends HTMLElement {
  constructor () {
    super()
    this.attachShadow({mode:"open"})
  }

  connectedCallback () {
    this.shadowRoot.innerHTML = "<div contenteditable='true'></div>"
    this.shadowRoot.addEventListener("selectionchange", () => {
      console.warn("Selection modified")
    })
  }
})

document.body.innerHTML += "<test-element></test-element>"

What is the expected behavior?
The selectionchange event should fire when a [contenteditable] element is modified inside of a shadow root.

What went wrong?
The event didn't fire fire. It does however, fire on the global Document.

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 64.0.3282.186 (Developer Build) (64-bit)  Channel: n/a
OS Version: 4.15.6-1-ARCH
Flash Version:
 

Comment 1 by xenx...@gmail.com, Mar 2 2018

"modified" should read "selected" - sorry for any confusion.
Labels: Needs-Triage-M64
Cc: susan.boorgula@chromium.org
Labels: -Type-Bug Triaged-ET M-67 FoundIn-67 Type-Feature
Status: Untriaged (was: Unconfirmed)
xenxier@ Thanks for the issue.

From the Bug title, this is a Feature Request.
Hence marking this as Untriaged for further updates from Dev.

Thanks..

Comment 4 by yosin@chromium.org, Mar 16 2018

Components: -Blink>Editing Blink>Editing>Selection
Labels: -Pri-2 Pri-3
Status: Available (was: Untriaged)

Sign in to add a comment