mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 23:37:43 +03:00
Fixed initial role selection and layout shift in <GhRoleSelection>
no issue - initial role was always being set to Contributor due to incorrect argument being used when checking if the default role should be applied - there was considerable layout shift of the `<GhRoleSelection>` container after role loading was finished, quick-fix applied by specifying a width and height to the loading spinner container that matches the final width/height
This commit is contained in:
parent
c3c383ae69
commit
824953d162
@ -1,6 +1,9 @@
|
||||
<div class="gh-roles-container" {{did-insert (perform this.fetchRolesTask)}}>
|
||||
{{#if this.fetchRolesTask.isRunning}}
|
||||
<GhLoadingSpinner />
|
||||
{{!-- width and height are needed to avoid layout shift after roles have loaded --}}
|
||||
<div style="width: 486px; height: 268px">
|
||||
<GhLoadingSpinner />
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="gh-radio {{if (eq @selected.name "Contributor") "active"}}" {{on "click" (fn this.setRole "Contributor")}} data-test-option="Contributor">
|
||||
<div class="gh-radio-button"></div>
|
||||
|
@ -28,7 +28,7 @@ export default class GhRoleSelectionComponent extends Component {
|
||||
|
||||
this.roles = roles;
|
||||
|
||||
if (!this.args.role && defaultRole) {
|
||||
if (!this.args.selected && defaultRole) {
|
||||
this.args.setRole(defaultRole);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user