GithubHelp home page GithubHelp logo

nowely / marked-input Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 1.0 2.42 MB

Сombine editable text with any component via annotations.

Home Page: https://marked-input.vercel.app/

License: MIT License

TypeScript 95.95% CSS 1.53% JavaScript 2.19% HTML 0.33%
react component typescript highlight markup mention input overlay suggestion javascript

marked-input's People

Contributors

nowely avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

stigmat4j

marked-input's Issues

Can't get cursor position

I want to get current caret position. For example, for the image below:
Screenshot 2023-06-05 at 07 57 01
I would like to get cursor position 2 (0 being the initial cursor position, if text was empty)

Normally I would achieve using something like this:

const handleOnClick = () => {
   if (inputRef.current && inputRef.current.inputRef) {
        const { selectionStart, selectionEnd } = inputRef.current.inputRef;
        console.log('Selection Start:', selectionStart);
        console.log('Selection End:', selectionEnd);
   }
 }
 <MarkedInput
        ref={inputRef}
        Mark={RemovableMark}
        value={value}
        onChange={onChange}
      />

But inputRef doesn't jave current inputRef, so I can't use selectionStart and selectionEnd.

Markup tags not getting added after new line is added

Markup tags not getting added after new line is added

Steps to reproduce

  1. Add new line by hit enter button and type some text.
  2. Type trigger text (in my case {{ ). It shows suggestion overlay.
  3. From overlay when user click suggestion i've called select to add markup
    const { select } = useOverlay(); .... .... select({label:"some-label", "value":"some-value"})

Version Used
rc-marked-input: 3.0.1

Reference
Screen Shot 2023-09-14 at 9 03 02 am

Markdown going all to the right

My markup is going all to the right of my text area, like the video shows. I used the same model as the example:
https://codesandbox.io/s/configured-marked-input-forked-4svlb7?file=/src/Button.tsx

But the behavior is like the video and not like the example (expected behavior). What can be going wrong? Since I used the same elements, I expected similar behaviour. Thank you!

I would like to have them in between my text, like this:
Screenshot 2023-05-30 at 08 13 15

Screen.Recording.2023-05-30.at.08.02.45.mov

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.