Skip to content

QEditor: clicking away from linkEditor leaves a broken link #18289

@robgwin

Description

@robgwin

What happened?

In q-editor, select some text, click the link button, paste in a URL. Instead of hitting enter or "update", click back into the main editor to continue writing. It looks like you've successfully added the link, so you carry on, unaware that it saved as "https://" because you didn't apply it.

What did you expect to happen?

Either:

A. If I haven't actually applied the URL, the text should not appear as linked, or

B. The link should be applied when I click away from the link editor

I think option B probably makes more sense, because it also handles the scenario of re-editing an existing link, and I think it matches what a typical user would expect (No other editor content requires an explicit "update" action.)

It seems like this could be accomplished by adding an onBlur() callback after the onKeydown callback in editor-utils.js:getLinkEditor()

        onBlur: () => {
          updateLink()
        },

Reproduction URL

https://stackblitz.com/edit/quasarframework-stackblitz-templates-fysxxjxb?file=src%2Fpages%2FIndexPage.vue

How to reproduce?

(Note you can also reproduce this directly on https://quasar.dev/vue-components/editor)

  1. Select any unlinked word and click the link tool
  2. Paste in a URL (do not hit enter or update)
  3. Click in the main editor window
  4. Notice the word appears linked
  5. Select the word again and click the link tool
  6. Notice the link is actually 'https://'

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

Chrome

Quasar info output

Relevant log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions