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

    q-editor; insert markup at carat position, after losing focus

    Help
    q-editor
    1
    1
    441
    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.
    • Merrick
      Merrick last edited by

      I had insert working well for some hardcoded markup, using code like the following:

        const caretRange = this.$refs['q-editor'].caret.range
        const imgMarkup = this.inlineImageMarkup(image.masterImage.publicUrl)
        const htmlFrag = caretRange.createContextualFragment(imgMarkup)
        caretRange.insertNode(htmlFrag)
        caretRange.collapse(false)
      

      Once I added an image select modal into the mix, I’d lose focus, and carat position. Though I can clone the carat info, I don’t see a way to set it & Vue complained when I tried.

      How can I insert markup in q-editor, at a specific position, after losing focus there?

      Thanks! 🙂

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