floating blocks cause placeholder to be mispositioned
See original GitHub issue<div>
<img style="float: left">
<Slate />
</div>
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
1323517 - float with writing-mode orthogonal to its containing block ...
My first guess at where this would be going wrong is that for some reason this test would be failing when it should...
Read more >How to fix wrongly positioned draggable helpers for ...
I'm experiencing a problem where the draggable helper is being offset incorrectly, when using draggables + sortables that are placed in floating ...
Read more >Floated Labels Still Suck - Web Axe
The post points out that it's bad practice to use text to look and behave as a placeholder rather than a label. This...
Read more >Blazy filter messes up the node body html [#3081148] - Drupal
The result is that the html content of these block gets messed up AND some of the blazy loaded images from the main...
Read more >FCKeditor ChangeLog - What's New?
[#2065] Floating dialogs will now block the user from re-selecting the editing area by pressing Tab. [#2114] Added a workaround for an IE6...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, good news and bad news!
Your question prompted me to deep dive into the placeholder. And turns out we don’t actually need to use a
<Portal>
to render it. So I was able to simplify how it’s rendered. Now it’s just a child at the same level withcontentEditable={false}
.But, it’s still positioned absolutely by default, since this it the best for general cases.
But but, you should be able to pass
style={...}
to it, so you can customize it to handle your case. I believe you’ll want to float it to the left, and use make it zero-width. Something like:I think that will do it. The reason it’s not on by default is that it breaks for multi-line placeholders, so you’ll have to make sure your placeholder text is really short.
That’s the best I think we can do! But if anyone figures out a more bulletproof set of styles for the default let me know.
ok I’ll check it out, thanks!