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 auto-scrolling and highlighting current concept in hierarchy #1372

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

osma
Copy link
Member

@osma osma commented Oct 4, 2022

Reasons for creating this PR

The custom scrollbar implementation was removed in PR #1360. But the PR also removed some functionality from the hierarchy tree: highlighting the current concept and automatically scrolling so that the current concept (or at least one of the places where it appears) is visible. This PR restores those functionalities. It also cleans up some leftover JS code.

Link to relevant issue(s), if any

Description of the changes in this PR

  • select the active node(s) in the hierachy after the page has loaded
  • automatically scroll the hierarchy display so that the active node is visible and centered (this is now done using the standard Element.scrollIntoView method instead of using mCustomScrollbar methods)
  • remove the getLeafOffset method that was used by the previous scrolling method but is now unnecessary

Known problems or uncertainties in this PR

The auto-scrolling now works a bit differently than in 2.15: it may not scroll exactly the same amount, and the scrolling is smooth instead of instant. I like the smooth scrolling better but this can be easily disabled by adjusting the behavior option of scrollIntoView.

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@osma osma added the bug label Oct 4, 2022
@osma osma added this to the 2.16 milestone Oct 4, 2022
@osma osma self-assigned this Oct 4, 2022
@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Base: 71.17% // Head: 71.17% // No change to project coverage 👍

Coverage data is based on head (2ada973) compared to base (77eb4a2).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1372   +/-   ##
=========================================
  Coverage     71.17%   71.17%           
  Complexity     1650     1650           
=========================================
  Files            32       32           
  Lines          3788     3788           
=========================================
  Hits           2696     2696           
  Misses         1092     1092           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sonarcloud
Copy link

sonarcloud bot commented Oct 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@joelit joelit left a comment

Choose a reason for hiding this comment

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

Works fine with Chrome, Firefox, and Edge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants