IBX-7690: [Full view] Exit full view should redirect user to View tab, not Fields #1187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
v4.6
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 thisinstead of this
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:
@ibexa/engineering
).