Yoopta-Editor icon indicating copy to clipboard operation
Yoopta-Editor copied to clipboard

[BUG] Can't override the default style paddingBottom on the editor itself with the style prop.

Open Keneficka opened this issue 9 months ago • 1 comments

Has this bug been raised before?

  • [x] I have checked "open" AND "closed" issues and this is not a duplicate

Description

Can't override the default style paddingBottom on the editor itself with the style prop.

The default from the readme { width: '400px', paddingBottom: '100px' }

My styles:

<YooptaEditor
   style={{width: '100%', paddingBottom: '0px'}}
/>

The width works but the padding stays 100px. I was able to set it with !important so not urgent.

.yoopta-editor {
  padding-bottom: 0 !important;
}

And by the way awesome editor thanks!

Screenshots

No response

Do you want to work on this issue?

No

Keneficka avatar Feb 14 '25 03:02 Keneficka

@Keneficka you can override it if you pass a class to YooptaEditor that overrides the padding bottom.

For example:

.override {
padding-bottom: 2px;
}
 <YooptaEditor
          className='override'
          editor={editor}
          selectionBoxRoot={selectionRef}
          value={value}
          onChange={handleOnChange}
/>

I understand why that's there, as a workaround to still display the editor and make it clickable when is completely empty. But we should come up with a better idea. Maybe apply a min-height, instead of a padding, and it should only be applied on :empty.

I will have a look at this one.

gloaysa avatar Apr 21 '25 07:04 gloaysa