jefflangtech / intro-section

Repo for Front End Mentor Intro Section Challenge
0 stars 0 forks source link

Menu close on mouseout should only work on desktop version not mobile version #1

Open jefflangtech opened 2 years ago

jefflangtech commented 2 years ago

On the mobile version of the page, with the slide-out drawer nav, a sub-menu will close when moused out. The mouseout menu close feature should only work on the desktop version of the page since it creates a little bit of weirdness for the mobile user (or smallified version of the desktop site). The function should distinguish between the desktop version and mobile version and apply only as needed.

jefflangtech commented 2 years ago

Basic fix implemented. Mouseout menu close still functions after switching from desktop screen size to mobile screen size and then opening menu. A better solution should prevent this

jefflangtech commented 2 years ago

No luck so far trying to compare the nav.scrollWidth before calling the close menu function. Still not quite sure how to prevent this after resizing from desktop to mobile. The bug only occurs after clicking and mousing out of a menu, then resizing from desktop to mobile