question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
  • This issue comes from the playground example.
  • The <img /> 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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
acywatsoncommented, Oct 17, 2022

Yea, this sounds like it could be improved. PR is welcome here.

0reactions
ScottAgirscommented, Oct 29, 2022

Hey Acy,

Wooho, sounds great, will do! I’m taking off for conference travels for next 2 weeks, can’t wait to be back and set up a Zoom coffee “)

Cheers, @SᴄᴏᴛᴛAɢɪʀs On Oct 26, 2022, 4:59 PM +0300, Acy Watson @.***>, wrote:

I’m not sure if this is a bug or the expected UX. I think this would be the expected behaviour if the editor was in readonly mode, in which case we could make the image responsive for smaller viewports, but if we want the user to explicitly set the pixel value of the underlying image, we shouldn’t probably then override that if the editor viewport becomes smaller (with I’m presuming an intersection observer?). I don’t think you need an intersection observer for this. It’s just about preserving the aspect ratio of the img AFAICT, which should be something we can do with CSS. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS image resize issue - html - Stack Overflow
I have a problem when resizing images I have ...
Read more >
Error trying to resize some JPGs (i.e. after XnView saved it ...
Issue -Bug Something isn't working Product-Image Resizer Things regarding image resizing module Resolution-Won't fix A topic we won't fix.
Read more >
Resizing background images with background-size - CSS
The background-size CSS property lets you resize the background image of an element, overriding the default behavior of tiling the image at ...
Read more >
Resizing an image in a post? - Meta Stack Exchange
@CiroSantilli You need to put the parameters in order: src , width , height . Ran into the same problem myself and didn't...
Read more >
PowerToys Image Resizer utility for Windows - Microsoft Learn
Image Resizer allows you to resize images by dragging and dropping your selected files with the right mouse button. This way, resized pictures...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found