react-uwp
react-uwp copied to clipboard
Fix NavigationView.autoResize
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:
- Load with 1280+ width
- Resize to <1280
- Resize back to 1280+
Also, unless either removed completely or replaced with original props.initWidth it'll just overwrite user's value which undesired.
👍 Hi, thanks for the pr, i will test this new logic on the browser.