-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clearing inline content makes editor momentarily collapse #54
Comments
Erm...do you by chance mean debouncing? 😉 There is view.inDOMChange but it's undocumented so I'd be hesitant to use it. The other, probably more viable one, is to find a way for the placeholder to predict the next state change based on incoming events, that way it will update with the DOM, rather than asynchronously due to a change in state. I'll dig into this some more |
It's not private though? Unless ProseMirror doesn't use the underscore convention |
Don't know whether they do or not, which means I'd err on the side of undocumented -> can break in a patch. Easiest way to solve this is probably just bring it up in their discussion forums / raise an issue on GitHub. |
Yep, I'd say so. File an issue on whether inDom thing is public interface or not |
Actually, that's not gonna work 🤔 The placeholder plugin listens to changes after the state has changed on the view - at that point checking a few things including if the state is empty before saying it should update the state with a placeholder decoration. I'd say the way to do it is to try add the decoration before the updated state has been applied to the view. Not sure how to do that though. |
Hmm okay. It does feel pretty buggy, but only breaking with inline text elements that rely on their content for height. And even then, only breaking minorly in edit mode. So I wouldn't dive too deep on it now, but worth tinkering with a fix for. |
Since ProseMirror denounces state updates, the placeholder for simpla-text doesn't show up until a little while after content is cleared. This is fine for block elements, but for inline simpla-texts the element's height collapses to 0, causing a jarring page reflow.
Related (but more minor) issue: entering content in an empty element 'pushes' the placeholder along for a bit before it's cleared.
Both issues would be solved if we could prevent the placeholder state updates from denouncing.
The text was updated successfully, but these errors were encountered: