Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
91582937
Commit
91582937
authored
5 years ago
by
ThibG
Committed by
Eugen Rochko
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix crash when switching back/from mobile layout (#11655)
Fixes #11630
parent
bd4099d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/javascript/mastodon/components/column_back_button.js
+13
-1
13 additions, 1 deletion
app/javascript/mastodon/components/column_back_button.js
app/javascript/mastodon/components/column_header.js
+13
-1
13 additions, 1 deletion
app/javascript/mastodon/components/column_header.js
with
26 additions
and
2 deletions
app/javascript/mastodon/components/column_back_button.js
+
13
−
1
View file @
91582937
...
...
@@ -35,7 +35,19 @@ export default class ColumnBackButton extends React.PureComponent {
if
(
multiColumn
)
{
return
component
;
}
else
{
return
createPortal
(
component
,
document
.
getElementById
(
'
tabs-bar__portal
'
));
// The portal container and the component may be rendered to the DOM in
// the same React render pass, so the container might not be available at
// the time `render()` is called.
const
container
=
document
.
getElementById
(
'
tabs-bar__portal
'
);
if
(
container
===
null
)
{
// The container wasn't available, force a re-render so that the
// component can eventually be inserted in the container and not scroll
// with the rest of the area.
this
.
forceUpdate
();
return
component
;
}
else
{
return
createPortal
(
component
,
container
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/column_header.js
+
13
−
1
View file @
91582937
...
...
@@ -178,7 +178,19 @@ class ColumnHeader extends React.PureComponent {
if
(
multiColumn
||
placeholder
)
{
return
component
;
}
else
{
return
createPortal
(
component
,
document
.
getElementById
(
'
tabs-bar__portal
'
));
// The portal container and the component may be rendered to the DOM in
// the same React render pass, so the container might not be available at
// the time `render()` is called.
const
container
=
document
.
getElementById
(
'
tabs-bar__portal
'
);
if
(
container
===
null
)
{
// The container wasn't available, force a re-render so that the
// component can eventually be inserted in the container and not scroll
// with the rest of the area.
this
.
forceUpdate
();
return
component
;
}
else
{
return
createPortal
(
component
,
container
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment