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

Clear selection on page change #1631

Conversation

ctcuff
Copy link
Contributor

@ctcuff ctcuff commented Dec 14, 2020

Any text highlighted on a page now gets cleared when navigating to different pages using the nav button at the top/bottom of modules. For this issue, I've added a clearSelection() function to the nav-util but I'm open to moving it to a different file if appropriate.

Fixes #1618

maufcost
maufcost previously approved these changes Dec 17, 2020
Copy link
Contributor

@maufcost maufcost left a comment

Choose a reason for hiding this comment

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

LGTM! I tested with a myriad of module numbers, and they worked great on my end. Good job!

Copy link
Member

@zachberry zachberry left a comment

Choose a reason for hiding this comment

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

This clears the selection when using the top and bottom buttons but doesn't when using the left-hand nav menu. Also I'm weary of doing any DOM manipulation in the *-util classes (not that we're perfect about that).

Instead, I'm thinking add something to viewer-app's componentDidUpdate method. There's a method that gets called there - scrollToTopIfNavTargetChanging - We could add a similar method where that gets called - clearSelectionIfNavTargetChanging. (Or combine both into scrollToTopAndClearSelectionIfNavTargetChanging, but nobody seems to like my super-long function names)

Copy link
Member

@zachberry zachberry left a comment

Choose a reason for hiding this comment

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

(I merged in dev/16)

Awesome, approved!

@zachberry zachberry merged commit 34e9990 into ucfopen:dev/16-connemara-marble Jan 22, 2021
@zachberry zachberry added this to the 16 - Connemara Marble milestone Feb 2, 2021
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.

3 participants