Skip to content

Commit 7317975

Browse files
fix: show the full screen toolbar in read only instances as well (#5746)
1 parent 39195d0 commit 7317975

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/editor/src/core/extensions/custom-image/components/image-block.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,10 @@ export const CustomImageBlock: React.FC<CustomImageBlockProps> = (props) => {
201201
// show the image loader if the remote image's src or preview image from filesystem is not set yet (while loading the image post upload) (or)
202202
// if the initial resize (from 35% width and "auto" height attrs to the actual size in px) is not complete
203203
const showImageLoader = !(remoteImageSrc || imageFromFileSystem) || !initialResizeComplete;
204-
// show the image utils only if the editor is editable, the remote image's (post upload) src is set and the initial resize is complete (but not while we're showing the preview imageFromFileSystem)
205-
const showImageUtils = editor.isEditable && remoteImageSrc && initialResizeComplete;
204+
// show the image utils only if the remote image's (post upload) src is set and the initial resize is complete (but not while we're showing the preview imageFromFileSystem)
205+
const showImageUtils = remoteImageSrc && initialResizeComplete;
206+
// show the image resizer only if the editor is editable, the remote image's (post upload) src is set and the initial resize is complete (but not while we're showing the preview imageFromFileSystem)
207+
const showImageResizer = editor.isEditable && remoteImageSrc && initialResizeComplete;
206208
// show the preview image from the file system if the remote image's src is not set
207209
const displayedImageSrc = remoteImageSrc ?? imageFromFileSystem;
208210

@@ -258,7 +260,7 @@ export const CustomImageBlock: React.FC<CustomImageBlockProps> = (props) => {
258260
{selected && displayedImageSrc === remoteImageSrc && (
259261
<div className="absolute inset-0 size-full bg-custom-primary-500/30" />
260262
)}
261-
{showImageUtils && (
263+
{showImageResizer && (
262264
<>
263265
<div
264266
className={cn(

0 commit comments

Comments
 (0)