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.

minHeight is no longer respected in slate-react 0.62+

See original GitHub issue

Description This commit introduces a regression where slate editors min-height is now constantly being set.

Recording image

Sandbox https://stackblitz.com/edit/react-f4v5on

Expectation I should be able to control the minHeight of my editor based on this value

Environment

  • Slate Version: 0.62+

Context

I’m no longer able to specify a minHeight on my <Editable /> and have it be respected, this is problematic because I have been relying on minHeight to specify the size my editors initialize with

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:12
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
hanfordcommented, Jan 2, 2022

I’ve been able to restore the older functionality by directly commenting out the useEffect in slate-react with this patch: https://gist.github.com/hanford/4f5c2257ef51500cf4182efbe86194fe

I’d recommend using this with https://www.npmjs.com/package/patch-package

2reactions
aaron-swarmcommented, Jul 8, 2021

As a workaround:

useEffect(() => {
  const editorEl = document.querySelector<HTMLDivElement>(
    '[data-slate-editor="true"]',
  );
  editorEl.style.minHeight = `300px`;
}, []);
Read more comments on GitHub >

github_iconTop Results From Across the Web

slate-react / Editable / min-height-style · Issue #4233 - GitHub
So if this is not absolutely necessary, it would be better to remove this styling so that an !import is not necessary. Screenshots...
Read more >
Slate React
Your custom event handler can control whether or not Slate should execute its own event handling for a given event after your handler...
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