Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Events firing on parents of elements with contenteditable attribute

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #146285
    liamm
    Participant

    If an element with the contenteditable attribute set to true is the child of another element with the content editable attribute set to true it appears that any events fired are on the parent rather than the child. How can this behaviour be prevented?

    http://codepen.io/anon/pen/xtnwi

    #146286
    Paulie_D
    Member

    I don’t know if it will make a difference but your HTML is a little off.

    `<a href="#">
      <img src="logo.png" />
    </a>`
    
    #146287
    liamm
    Participant

    It was just a quick example, I tried it in a variety of cases and it seems to always be a problem.
    I can resolve it by wrapping the child inside an element with contenteditable set to false but I’d rather not do that.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.