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

Navbar: mobile version not working on load time with react-router-dom #1631

Open
tishoyanchev opened this issue Dec 5, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@tishoyanchev
Copy link
Contributor

tishoyanchev commented Dec 5, 2024

Detailed description of how to reproduce the problem

 <BrowserRouter>
      <Routes>
        <Route path="/" element={<Navbar/>}/>
      </Routes>
    </BrowserRouter>

When react-router-dom is used, if the screen size is small on page load, the mobile version is not working on the Navbar, which causes errors.
The right-side items are not hidden inside the mobile sidebar on page load, and thus when expanding the screen, there is an error because an attempt is made to query the mobile items.
Cannot read properties of null (reading 'setAttribute') .. caused by searchBarRight.setAttribute('slot', 'search-bar-left');

Upload a screenshot

mobile version error

Describe the development framework

React

Expected behavior

Nav-items should be hidden on mobile resolution
mobile version correct behavior

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant