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

Fix NavigationView.autoResize

Open KeyWeeUsr opened this issue 6 years ago • 1 comments

https://github.com/myxvisual/react-uwp/blob/096b8239b2b864db8658656a18a595d082becc32/src/NavigationView/index.tsx#L151

This piece of code seems wrong to me if used with this piece of code:

<NavigationView
    pageTitle="Test"
    background="#FF0000"
    defaultExpanded={ true }
    expandedWidth={ 260 }
    isControlled={ true }
/>

it makes the NavigationView background disappear and first the remaining menu will overlay the content (until clicked / unfocused) and at the same time the whole layout is moved in the original place of the NavigationView. Or in other words, the logic seems inverted.

Also another issue is when the currInitWidth: 0 is set because then these steps will remove the element completely from user's view and it can't be retrieved back without dev tools:

  1. Load with 1280+ width
  2. Resize to <1280
  3. Resize back to 1280+

Also, unless either removed completely or replaced with original props.initWidth it'll just overwrite user's value which undesired.

KeyWeeUsr avatar Nov 24 '19 15:11 KeyWeeUsr

👍 Hi, thanks for the pr, i will test this new logic on the browser.

myxvisual avatar Nov 26 '19 10:11 myxvisual