question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link input field is cut off in RichTextInput

See original GitHub issue

What you were expecting: The input field for adding a link to a word/sentence in the ra-input-rich-text should be on top of everything, no matter where the word is situated in the text.

What happened instead: The input field gets cut off by the actual content area.

Steps to reproduce: As experienced on the demo page:

  • Try to add a link to the first word
  • The link input field opens, but appears underneath the save button (see screenshot below)

Other information: This is what happens when I’m trying to add a link to the first word in the editor: screen shot 2018-08-02 at 20 28 03 I’m guessing something went wrong when transforming the Quill theme to JSS? Overall, the theming of the RichTextInput feels weird.

Environment

  • React-admin version: 2.2.0
  • React version: 16.4.2
  • Browser: latest Chrome on OSX, same for Safari

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
wwarnecommented, Oct 22, 2018

Sorry to bother but it seems to me that this fixes only one part of the problem. Then you try to add a link to the first word the input field is cut off by the left side. It’s because it has style with negative values like left: -107.5px; 2018-10-22_194426 2018-10-22_194452

0reactions
fzaninottocommented, Oct 14, 2020

The bug comes from an incompatibility between material-ui’s <Card> component and Quill’s positioning algorithm for the link tooltip. In my opinion, this is not something we can fix in react-admin, because the fix requires altering the Card style in Edit and Create views, and we can’t do that in the general way without nasty side effets.

Note that the fix is easy in user land:

import { Edit, SimpleForm, TextInput } from 'react-admin';
+import { withStyles } from '@material-ui/core/styles';

-const PostEdit = props => (
+const PostEdit = withStyles({ card: { overflow: 'initial' } })(props => (
   <Edit {...props}>
       <SimpleForm>
            // ...
       </SimpleForm>
   </Edit>
-);
+));

I think the best way for react-admin to tackle this bug is by adding the above snippet in the documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does the text inside an <input> tag get cut off even if ...
The input text box cuts off the tail of character 'j', while the div text box does not. HTML: <input type="text" value="juvenescent" /> ......
Read more >
Sculpt Block Rich Text Input Field - Cordial Knowledge Base
The rich text field automatically creates line breaks and paragraph spacing as the marketer organizes content using keystrokes.
Read more >
Input Components - React-admin - Marmelab
An Input component displays an input, or a dropdown list, a list of radio ... <RichTextInput> displays link tooltip as cut off when...
Read more >
Rich Text Editor - Bubble Docs
The Rich Text Editor Plugin creates an element that allows users to type a rich formatted text with colors, fonts, bullet points, link,...
Read more >
@mochilabs/ra-input-rich-text - npm
For editing HTML with react-admin, use the <RichTextInput> component. ... <RichTextInput> displays link tooltip as cut off when the user ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found