Git Product home page Git Product logo

Comments (2)

sstur avatar sstur commented on June 22, 2024

I'd like to implement the following behavior:

When your cursor is on a link (no selection) and you click the link button:

  • The link gets selected.
  • The URL of that link gets populated into the InputPopover.

When there is a selection and you click the link button:

  • If the entire selection links to one URL, populate that into the InputPopover
  • When the InputPopover is submitted, clear any existing link(s) from selected text and create a new link to the specified URL.

from react-rte.

sstur avatar sstur commented on June 22, 2024

There has been an attempt at this in #59 but it does not exactly conform to the behavior outlined above. There is some discussion on that issue about edge cases.

For instance, "when people put cursor between two links, editor doesn't know which link to edit. Former or latter?" I believe there is an expectation that the cursor is considered "on" the character to the left of it (unless the cursor is at the beginning in which case it is considered on the character to the right). This coincides with the cursor behavior of inline styles.

from react-rte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.