Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NavigationView.autoResize #98

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

KeyWeeUsr
Copy link

@KeyWeeUsr KeyWeeUsr commented Nov 24, 2019

if (window.innerWidth < 1280) {

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.

@myxvisual
Copy link
Owner

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

@myxvisual myxvisual self-assigned this Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants