react-spaces icon indicating copy to clipboard operation
react-spaces copied to clipboard

<Fill/> width can exceed <ViewPort/> width

Open Nantris opened this issue 2 years ago • 0 comments

Describe the bug In versions 0.2.6 and 0.3.2, using react-spaces as a controlled component, we're seeing an issue where resizing an anchored space on the left side of the screen to a smaller size can result in a situation like this:

window.innerWidth: 940px Viewport width: 940px Left Anchored width: 96px - although React state shows anchorSize: 34 Fill space width: 1035px

Note that 940px + 96px = 1036px ~== 1035px, perhaps a hint as to the cause

To Reproduce I'm not entirely sure how to reproduce this. Is there a CodeSandbox to use as a jumping off point?

Expected behavior All spaces should remain within the rendered portion of the viewport and the combined widths should not exceed window.innerWidth

Screenshots

image

image

Package versions (please complete the following information):

  • React version: 17.0.2
  • React spaces version: 0.2.6 & 0.3.2

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows 7/10
  • Browser [e.g. chrome, safari] Electron
  • Version [e.g. 22] 11.4.x

Code sandbox link None available currently

Additional context Thank you for your work on this increasingly awesome project!

Nantris avatar Nov 23 '21 20:11 Nantris