]> cat aescling's git repositories - mastodon.git/commitdiff
Change styling to always have scrollbar on search results
authorThibaut Girka <thib@sitedethib.com>
Mon, 17 Aug 2020 12:05:59 +0000 (14:05 +0200)
committerThibG <thib@sitedethib.com>
Mon, 17 Aug 2020 13:46:18 +0000 (15:46 +0200)
app/javascript/flavours/glitch/features/compose/components/search_results.js
app/javascript/flavours/glitch/styles/components/drawer.scss

index fa3487328ba93acfbdbb9c9d1e6df9fa4accd8b4..bbf997c1f0c76fb5582493cc29a500608786c50d 100644 (file)
@@ -125,9 +125,11 @@ class SearchResults extends ImmutablePureComponent {
           <FormattedMessage id='search_results.total' defaultMessage='{count, number} {count, plural, one {result} other {results}}' values={{ count }} />
         </header>
 
-        {accounts}
-        {statuses}
-        {hashtags}
+        <div className='search-results__contents'>
+          {accounts}
+          {statuses}
+          {hashtags}
+        </div>
       </div>
     );
   };
index d5463e4068433c180aa22ccbb68feef09f3a6433..fa410234a8db35d037f60bbab26be9d8ea62d6bd 100644 (file)
 
 .drawer--results {
   background: $ui-base-color;
-  overflow-x: hidden;
-  overflow-y: auto;
+  overflow: hidden;
+  display: flex;
+  flex-direction: column;
+  flex: 1 1 auto;
 
   & > header {
     color: $dark-text-color;
     font-weight: 500;
     font-size: 16px;
     cursor: default;
+    flex: 0 0 auto;
 
     .fa {
       display: inline-block;
     }
   }
 
-  & > section {
-    margin-bottom: 5px;
-
-    h5 {
-      background: darken($ui-base-color, 4%);
-      border-bottom: 1px solid lighten($ui-base-color, 8%);
-      cursor: default;
-      display: flex;
-      padding: 15px;
-      font-weight: 500;
-      font-size: 16px;
-      color: $dark-text-color;
-
-      .fa {
-        display: inline-block;
-        margin-right: 5px;
+  & > .search-results__contents {
+    overflow-x: hidden;
+    overflow-y: scroll;
+    flex: 1 1 auto;
+
+    & > section {
+      margin-bottom: 5px;
+
+      h5 {
+        background: darken($ui-base-color, 4%);
+        border-bottom: 1px solid lighten($ui-base-color, 8%);
+        cursor: default;
+        display: flex;
+        padding: 15px;
+        font-weight: 500;
+        font-size: 16px;
+        color: $dark-text-color;
+
+        .fa {
+          display: inline-block;
+          margin-right: 5px;
+        }
       }
-    }
 
-    .account:last-child,
-    & > div:last-child .status {
-      border-bottom: 0;
-    }
+      .account:last-child,
+      & > div:last-child .status {
+        border-bottom: 0;
+      }
 
-    & > .hashtag {
-      display: block;
-      padding: 10px;
-      color: $secondary-text-color;
-      text-decoration: none;
-
-      &:hover,
-      &:active,
-      &:focus {
-        color: lighten($secondary-text-color, 4%);
-        text-decoration: underline;
+      & > .hashtag {
+        display: block;
+        padding: 10px;
+        color: $secondary-text-color;
+        text-decoration: none;
+
+        &:hover,
+        &:active,
+        &:focus {
+          color: lighten($secondary-text-color, 4%);
+          text-decoration: underline;
+        }
       }
     }
   }