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

IBX-7690: [Full view] Exit full view should redirect user to View tab, not Fields #1187

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

GrabowskiM
Copy link
Contributor

Question Answer
JIRA issue https://issues.ibexa.co/browse/IBX-7690
Type bug
Target version v4.6
BC breaks no
Doc needed no

Thanks to this solution when we enter link like http://localhost:8000/admin/view/content/52/full/1/2#ibexa-tab-location-view-preview we are redirected to proper tab, but we're not scrolled to element with id #ibexa-tab-location-view-preview (which is tab, so we're scrolled to sth like this
Selection_854
instead of this
Selection_855

IN THEORY it works currently for links like http://localhost:8000/admin/view/content/52/full/1/2#ibexa-tab-location-view-sub_items#tab but that's more of a bug - in code to set proper tab we split by # and takes only first fragment, omitting #tab fragment entirely.
But as it's not correct link (there should be only one hash, or at least browsers recognizes only one hash) browser tries to find element with id ibexa-tab-location-view-sub_items#tab (which of course does not exist) and scroll to it, but as it fails to do so, it leaves content on top.

setTimeout(() => {...}, 0) is needed, as it's need to be fired in new cycle - if it's run in initial/main one, browser behaviour with scrolling to element is more important (or to say more properly, is done after reading and executing main thread of JS code)

Checklist:

  • Provided PR description.
  • Tested the solution manually.
  • Checked that target branch is set correctly (master for features, the oldest supported for bugs).
  • Asked for a review (ping @ibexa/engineering).

Copy link

sonarcloud bot commented Feb 21, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@dew326 dew326 merged commit 11b388b into main Feb 27, 2024
22 checks passed
@dew326 dew326 deleted the IBX-7690-redirect-to-view-tab branch February 27, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants