Skip to content

Commit

Permalink
fix(app-builder): horizontal scroll after code update
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Kadlec <[email protected]>
  • Loading branch information
kapetr committed Jan 22, 2025
1 parent 357af33 commit 99b4b93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,17 @@ export function EditableSyntaxHighlighter({
{value.at(-1) === '\n' ? `${value} ` : value}
</SyntaxHighlighter>

{!readOnly && (
<textarea
{...props}
ref={textAreaRef}
id={id}
className={classes.textarea}
value={value}
onChange={(event) => onChange?.(event.target.value)}
spellCheck="false"
aria-invalid={invalid || undefined}
/>
)}
<textarea
{...props}
ref={textAreaRef}
id={id}
className={classes.textarea}
value={value}
onChange={(event) => onChange?.(event.target.value)}
spellCheck="false"
readOnly={readOnly}
aria-invalid={invalid || undefined}
/>

{invalid && <WarningFilled className={classes.invalidIcon} />}
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/modules/apps/builder/ArtifactSharedIframe.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ $loading-size: rem(170px);
.loading {
position: absolute;
inset: 0;
&.empty {
background-color: $layer-02;
background-color: $layer-02;
&.isAppReady {
background-color: transparent;
}

:global(.#{$prefix}--loading-overlay) {
Expand Down
3 changes: 2 additions & 1 deletion src/modules/apps/builder/ArtifactSharedIframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ export function ArtifactSharedIframe({
(state === State.LOADING || isPending) && (
<div
className={clsx(classes.loading, {
[classes.empty]: !appliedCodeRef.current,
[classes.isAppReady]:
appliedCodeRef.current && state === State.READY,
})}
>
<Loading />
Expand Down

0 comments on commit 99b4b93

Please sign in to comment.