Skip to content

Commit

Permalink
Prevent descriptions from causing page scroll
Browse files Browse the repository at this point in the history
Still allow the user to scroll the description, just to be safe

Related to Issue #44
  • Loading branch information
BobChao87 committed Jan 12, 2022
1 parent d863c16 commit cdc0a42
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion components/marathon/Description.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div>
<div class="marathon-description-container">
<ElementMarkdown v-if="description" :markdown="description" />
<div class="is-centered">
<WidgetLoading :while="[ marathon ]" />
Expand All @@ -19,11 +19,13 @@ export default Vue.extend({
default: '',
},
},
async fetch(): Promise<void> {
await Promise.allSettled([
this.getMarathon(this.marathonId),
]);
},
computed: {
marathon(): FullMarathon|undefined {
return (this.$store.state.api.marathon as MarathonState).marathons[this.marathonId];
Expand All @@ -32,10 +34,20 @@ export default Vue.extend({
return this.marathon?.description;
},
},
methods: {
...mapActions({
getMarathon: 'api/marathon/get',
}),
},
});
</script>

<style lang="scss" scoped>
.marathon-description-container {
// Width of the screen minus the global "content padding"
max-width: calc(100vw - 2em);
// Allow users to view the whole thing anyways, but discourage it
overflow-x: auto;
}
</style>

0 comments on commit cdc0a42

Please sign in to comment.