Skip to content

Commit

Permalink
Don't truncate API autocomplete list items (fixes #404) (#405)
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Gieringer <78054+carlgieringer@users.noreply.github.com>
  • Loading branch information
carlgieringer authored Apr 29, 2023
1 parent 1e97958 commit 0ea7613
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions premiser-ui/src/ApiAutoComplete.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "~@react-md/form/dist/mixins";
@import "~react-md/src/scss/grids";

.rmd-floating-label {
// TODO(17) figure out the source of this (.md-text--secondary?)
Expand All @@ -15,3 +16,18 @@
@include rmd-form-theme-update-var(floating-top, 1.7rem);
}
}

.api-autocomplete-listbox {
.rmd-list-item__text {
// Don't wrap autocomplete results since they can be long and we want users to be able to see
// their whole value for context.
white-space: normal;
}
// On narrow screens, we want to recover some of the horizontal space so that there's more room
// for the value of the list items.
@media (max-width: $md-grid-tablet-breakpoint) {
.rmd-option {
@include rmd-list-theme-update-var(item-horizontal-padding, 0.5rem);
}
}
}
1 change: 1 addition & 0 deletions premiser-ui/src/ApiAutoComplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export default function ApiAutoComplete({
id={id}
name={name}
className="api-autocomplete"
listboxClassName="api-autocomplete-listbox"
data={suggestionsData}
labelKey={labelKey}
valueKey={labelKey}
Expand Down

0 comments on commit 0ea7613

Please sign in to comment.