nowely / marked-input Goto Github PK
View Code? Open in Web Editor NEWСombine editable text with any component via annotations.
Home Page: https://marked-input.vercel.app/
License: MIT License
Сombine editable text with any component via annotations.
Home Page: https://marked-input.vercel.app/
License: MIT License
I want to get current caret position. For example, for the image below:
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
Steps to reproduce
const { select } = useOverlay(); .... .... select({label:"some-label", "value":"some-value"})
Version Used
rc-marked-input: 3.0.1
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:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.