facebook / facebook/lexical

Playground, `ImageResizer />`: image overflows - `width`/`maxWidth` issue?

Open
#3,188 4 comments 0 reactions 0 assignees View on GitHub
all-platforms-bug images
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 14h
Merged PRs (30d)
55

Description

- This issue comes from the playground example.
- The `` component styling has not been altered
- I am happy to create a PR if y'all think the below is an actual issue and not something I'm missing/not understanding fully.
- If I'm missing something could someone please elaborate on usage of this?

Lexical version: `v0.5.0`

## Steps To Reproduce / The current behavior

1. Add image with "Insert image"
2. resize the added image to _some_ size
3. resize the screen to something small and see the original image overflow-x

Enough space for set width:
Screen Shot 2022-10-15 at 10 50 53 PM

Small screen (not enough space) for set width:
Screen Shot 2022-10-15 at 10 50 37 PM

## The expected behavior
Image to be resized to the desired size IF the screen space allows for it, otherwise shrink to `maxWidth: 100%`, which would result in something like this:

Screen Shot 2022-10-15 at 10 51 22 PM

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.