Comments (3)
This behavior is the default in draft js. One workaround can be to call toggleLink twice, once with the selection and the next with selection collapsed. Or maybe there's a better way.
from medium-draft.
Maybe the solution would be to do the same as for the bold and italic.
You create your link, if you continue to write right after link, the link expands.
If you select a part of the link, the toolbar shows up the link button is activated.
If you click on the link button, you unlink the section you've selected.
With this solution, you can't modify the URL once it has been created. You'll need to select the entire link, unlink it, and click again to create a new link. But I don't think it is too weird.
What do you think ?
from medium-draft.
But Bold, Italic also continues to be extended if it is at the last. If you make your last word B/I, and then continue writing in same or new line, new characters are also bold.
A solution could be to detect a space and toggle B I U, Link automatically or maybe toggle it anyway.
Current process is nothing but what draft docs state, RichUtils.toggleInlineStyle
and RichUtils.toggleLink
. But this needs to be modified so that new characters don't carry over the style just like I have modified RETURN presses so that new lines after header blocks are always unstyled.
from medium-draft.
Related Issues (20)
- Uncaught TypeError: props.getEditorState is not a function while using the separatorButton HOT 1
- ReadMe needs update HOT 1
- regarding images uploaded via editor HOT 1
- ToolbarComponent prop implemented?
- Is this library compatible with React Native? HOT 2
- Typescript support HOT 1
- Warning in the developer tools
- How can I close the floating styles-widget when clicking outside editable area?
- 5 high vulnerabilities HOT 1
- How to delete the image (from database) after using backspace in editor? HOT 1
- Getting medium like title text field at the top then the content HOT 1
- How to resize the image once added to the editor? HOT 1
- Any pointers on how to start implementing image block alignment
- Is it possible to add the Image resize/ alignment feature?
- Is this maintained anymore? Possible outdated draftjs causing block is not a BlockNode error HOT 4
- editorState.getSelection is not a function in functional component HOT 1
- My app crash HOT 3
- How to add style BLOCK_BUTTONS HOT 1
- Set style for Image HOT 2
- Typescript Version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from medium-draft.