Skip to content

Commit

Permalink
feat(picker): adds support for displaying full list without cutting c…
Browse files Browse the repository at this point in the history
…ontent
  • Loading branch information
hannahu authored and adrianschmidt committed Sep 10, 2019
1 parent 86afaf6 commit 7f0a31a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/picker/picker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When importing ListItem, see [Import Statements](/#import-statements).

<limel-example name="limel-example-picker-multiple" path="picker" />

### With icons
### With icons and displaying full list without cutting content

When importing ListItem, see [Import Statements](/#import-statements).

Expand Down
9 changes: 6 additions & 3 deletions src/components/picker/picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
.dropdown--list {
background-color: white;
position: absolute;
margin-top: pxToRem(-8);
max-height: pxToRem(250);
overflow-y: auto;
margin-top: pxToRem(-1);

&:not(.display-full-list) {
max-height: pxToRem(250);
overflow-y: auto;
}
}
13 changes: 12 additions & 1 deletion src/components/picker/picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export class Picker {
@Prop()
public multiple: boolean = false;

/**
* True if the dropdown list should be displayed without cutting the content
*/
@Prop()
public displayFullList: boolean = false;

/**
* Fired when a new value has been selected from the picker
*/
Expand Down Expand Up @@ -261,7 +267,12 @@ export class Picker {
style={{
width: `${boundingRect.width}px`,
}}
class="dropdown--list mdc-elevation-transition mdc-elevation--z4 mdc-menu-surface mdc-menu-surface--open"
class={`dropdown--list
mdc-elevation-transition
mdc-elevation--z4
mdc-menu-surface mdc-menu-surface--open
${this.displayFullList ? 'display-full-list' : ''}
`}
tabindex="-1"
>
<limel-list
Expand Down
1 change: 1 addition & 0 deletions src/examples/picker/picker-icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class PickerIconsExample {
value={this.selectedItems}
searchLabel={'Search your awesomenaut'}
multiple={true}
displayFullList={true}
searcher={this.search}
onChange={this.onChange}
onInteract={this.onInteract}
Expand Down

0 comments on commit 7f0a31a

Please sign in to comment.