Skip to content

Commit

Permalink
Bugfix: Tiptap RTE custom dimensions configuration (#2469)
Browse files Browse the repository at this point in the history
* tiptop min height configuration

* Removed `min-height`; credit to @innovoix

* Clarified the use of `display:flex`

* Changed to use `height` instead of `min-height`

as this will control the maximum height of the editor input area.

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
(cherry picked from commit a410c5c)
  • Loading branch information
busrasengul authored and leekelleher committed Oct 21, 2024
1 parent 613cb0c commit 716f37e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class UmbInputTiptapElement extends UmbFormControlMixin<string, typeof Um

const dimensions = this.configuration?.getValueByAlias<{ width?: number; height?: number }>('dimensions');
if (dimensions?.width) this.setAttribute('style', `max-width: ${dimensions.width}px;`);
if (dimensions?.height) element.setAttribute('style', `max-height: ${dimensions.height}px;`);
if (dimensions?.height) element.setAttribute('style', `height: ${dimensions.height}px;`);

this._toolbar = this.configuration?.getValueByAlias<UmbTiptapToolbarValue>('toolbar') ?? [[[]]];

Expand Down Expand Up @@ -173,6 +173,8 @@ export class UmbInputTiptapElement extends UmbFormControlMixin<string, typeof Um
}
#editor {
/* Required as overflow is set to auto, so that the scrollbars don't appear. */
display: flex;
overflow: auto;
border-radius: var(--uui-border-radius);
border: 1px solid var(--uui-color-border);
Expand All @@ -183,8 +185,7 @@ export class UmbInputTiptapElement extends UmbFormControlMixin<string, typeof Um
box-sizing: border-box;
height: 100%;
width: 100%;
min-height: 400px;
display: grid; /* Don't ask me why this is needed, but it is. */
pre {
background-color: var(--uui-color-surface-alt);
padding: var(--uui-size-space-2) var(--uui-size-space-4);
Expand Down

0 comments on commit 716f37e

Please sign in to comment.