Skip to content

Found 2 minor bugs in navbar.  #69

@GauravGupta993

Description

@GauravGupta993

The first one has been there in the navbar since the beginning.
image
Whenever user open a game or activity and then refreshes the page the navbar becomes like shown in image.

       if (location.pathname === "/") {
            list[0].classList.add("active");
            list[1].classList.remove("active");
            list[2].classList.remove("active");
        }

        if (location.pathname === "/games") {
            list[0].classList.remove("active");
            list[1].classList.add("active");
            list[2].classList.remove("active");
        }

        if (location.pathname === "/activities") {
            list[0].classList.remove("active");
            list[1].classList.remove("active");
            list[2].classList.add("active");
        }

The problem lies here in the above code. For example- Since we are checking if it is equal to "/games", it is not working during "/games/magicsquares" on reloading.
Changing it to this should solve it.

        if (location.pathname === "/") {
            list[0].classList.add("active");
            list[1].classList.remove("active");
            list[2].classList.remove("active");
        }

        if (location.pathname.includes("/games")) {
            list[0].classList.remove("active");
            list[1].classList.add("active");
            list[2].classList.remove("active");
        }

        if (location.pathname.includes("/activities")) {
            list[0].classList.remove("active");
            list[1].classList.remove("active");
            list[2].classList.add("active");
        }

For the second bug, it has appeared just after PR #56. Top of pages being hidden by navbar.
image

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions