No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Tree is not compatible with contenteditable attribute

    Framework
    2
    6
    183
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Patrick Spiegel last edited by

      https://codepen.io/anon/pen/GavaXj?&editable=true&editors=101

      Hello,

      it seems like the tree is not fully compatible with the contenteditable attribute. Use-Case is renaming items in the tree.

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        Try it with

        contenteditable="true"

        However, that isn’t going to get you anything reactive or updated. You’d need to do more, like here: https://codepen.io/supraniti/pen/Lypobx

        Scott

        1 Reply Last reply Reply Quote 0
        • P
          Patrick Spiegel last edited by

          Hello,

          Thanks for you example, however I wanted to keep my example simple. The heading of the tree items are not editable.
          The general problem is, that items with contenteditable enabled just keep losing focus whenever you click onto them, when they are located inside a tree

          By the way: contenteditable is just a shorthand for contenteditable="true" in vue.

          1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari last edited by s.molinari

            Yes, and it does work in your codepen too (at least changing the text does). Should have tested it first instead of believing you. 😁

            1d51d00a-f8da-487c-905d-d0a840b7570b-image.png

            So either I am misunderstanding what you are looking for or it is as I am thinking, you still need to “do” something with the “input”. A contenteditable span isn’t bound to any data on its own.

            Scott

            1 Reply Last reply Reply Quote 0
            • P
              Patrick Spiegel last edited by

              The body is not a problem. The problem are the blue headings. At least I have the problem on a current chrome version.

              1 Reply Last reply Reply Quote 0
              • s.molinari
                s.molinari last edited by

                Ah. Ok. Yeah. Maybe because the click event is getting caught somehow, because the headers need to do selection and expansion actions.

                So, I still don’t think contenteditable is the solution you need. You need to do something more like a swap in of an input, when clicked on and somehow avoid the click event for anything other than clicking the arrows to expand and collapse the branch/ tree. I could have sworn there was a prop to control just that too, but I’m not finding it.

                Scott

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post