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 opening side menu on multiple instances #4045

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

yileifeng
Copy link
Contributor

@yileifeng yileifeng commented Sep 26, 2022

Closes ramp4-pcar4/story-ramp#202

Fixes Storylines issue where page jumps to a previous map (with side menu already open) after opening side menu for a different map on the page. This is due to sidemenu IDs named the same so we end up calling rvFocus on the first element found. Instead, using $rootElement.find() should find the correct menu. Changes to sample page can be discarded after demo if needed.

Demo


This change is Reviewable

@github-actions
Copy link

Your demo site is ready! 🚀 Visit it here: https://fgpv-vpgf.github.io/fgpv-vpgf/multi-instance-sidemenu/samples/index-samples.html

Copy link
Contributor

@RyanCoulsonCA RyanCoulsonCA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @yileifeng)

Copy link
Member

@spencerwahl spencerwahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yileifeng)


packages/ramp-core/src/app/ui/sidenav/sidenav.service.js line 325 at r1 (raw file):

        $mdSidenav('left')
            .open()
            .then(() => $rootElement.find('md-sidenav[md-component-id="left"] button').first().rvFocus());

does the sidenav need an ID? Duplicate ids can mess with screenreaders so if we can avoid that we should.

Copy link
Contributor Author

@yileifeng yileifeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 6 files reviewed, 1 unresolved discussion (waiting on @RyanCoulsonCA and @spencerwahl)


packages/ramp-core/src/app/ui/sidenav/sidenav.service.js line 325 at r1 (raw file):

Previously, spencerwahl (Spencer Wahl) wrote…

does the sidenav need an ID? Duplicate ids can mess with screenreaders so if we can avoid that we should.

changed md-component-id to append -{map ID}, let me know if this works

Copy link
Contributor Author

@yileifeng yileifeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 6 files reviewed, 1 unresolved discussion (waiting on @RyanCoulsonCA and @spencerwahl)


packages/ramp-core/src/app/ui/sidenav/sidenav.service.js line 325 at r1 (raw file):

Previously, yileifeng (Yi Lei Feng) wrote…

changed md-component-id to append -{map ID}, let me know if this works

if so, can also update the other sidenav ID naming for basemaps (it is also just labeled right currently)

Copy link
Member

@spencerwahl spencerwahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 6 files reviewed, 1 unresolved discussion (waiting on @RyanCoulsonCA, @spencerwahl, and @yileifeng)


packages/ramp-core/src/app/ui/sidenav/sidenav.service.js line 325 at r1 (raw file):

Previously, yileifeng (Yi Lei Feng) wrote…

if so, can also update the other sidenav ID naming for basemaps (it is also just labeled right currently)

Turns out I misunderstood what kind of id this is and its actually just set as md-component-id which shouldn't cause any issues... my bad for not investigating further.

Can leave these changes in or revert, up to you.

Copy link
Contributor

@RyanCoulsonCA RyanCoulsonCA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yileifeng)

Copy link
Member

@james-rae james-rae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r1, 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yileifeng)

@james-rae james-rae merged commit 9c554d3 into fgpv-vpgf:master Oct 5, 2022
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.

[Pulp and Paper] Opening the menu on a map can cause the page to jump to a different map
4 participants