Skip to content

Commit 0b43ce5

Browse files
authored
fix: change default menu height (#624)
* fix: change default menu in selects
1 parent 667fefd commit 0b43ce5

File tree

11 files changed

+25
-14
lines changed

11 files changed

+25
-14
lines changed

src/components/fields/async-creatable-select-field/async-creatable-select-field.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ storiesOf('Components|Fields', module)
138138
isMulti={isMulti}
139139
placeholder={text('placeholder', 'Select...')}
140140
title={text('title', 'Favourite animal')}
141-
maxMenuHeight={number('maxMenuHeight', 200)}
141+
maxMenuHeight={number('maxMenuHeight', 220)}
142142
isSearchable={boolean('isSearchable', false)}
143143
isClearable={boolean('isClearable', false)}
144144
tabIndex={text('tabIndex', '0')}

src/components/fields/async-select-field/async-select-field.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ storiesOf('Components|Fields', module)
138138
isMulti={isMulti}
139139
placeholder={text('placeholder', 'Select...')}
140140
title={text('title', 'Favourite animal')}
141-
maxMenuHeight={number('maxMenuHeight', 200)}
141+
maxMenuHeight={number('maxMenuHeight', 220)}
142142
isSearchable={boolean('isSearchable', true)}
143143
isClearable={boolean('isClearable', false)}
144144
tabIndex={text('tabIndex', '0')}

src/components/fields/creatable-select-field/creatable-select-field.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ storiesOf('Components|Fields', module)
124124
isMulti={isMulti}
125125
placeholder={text('placeholder', 'Select...')}
126126
title={text('title', 'Favourite animal')}
127-
maxMenuHeight={number('maxMenuHeight', 200)}
127+
maxMenuHeight={number('maxMenuHeight', 220)}
128128
isSearchable={boolean('isSearchable', true)}
129129
isClearable={boolean('isClearable', false)}
130130
options={options}

src/components/fields/select-field/select-field.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ storiesOf('Components|Fields', module)
124124
isMulti={isMulti}
125125
placeholder={text('placeholder', 'Select...')}
126126
title={text('title', 'Favourite animal')}
127-
maxMenuHeight={number('maxMenuHeight', 200)}
127+
maxMenuHeight={number('maxMenuHeight', 220)}
128128
isSearchable={boolean('isSearchable', false)}
129129
isClearable={boolean('isClearable', false)}
130130
options={options}

src/components/inputs/async-creatable-select-input/async-creatable-select-input.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class SelectStory extends React.Component {
7979
isDisabled={boolean('isDisabled', false)}
8080
isMulti={isMulti}
8181
isSearchable={boolean('isSearchable', true)}
82-
maxMenuHeight={number('maxMenuHeight', 200)}
82+
maxMenuHeight={number('maxMenuHeight', 220)}
8383
name={text('name', 'form-field-name')}
8484
onBlur={action('onBlur')}
8585
onChange={(event, info) => {

src/components/inputs/async-select-input/async-select-input.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class SelectStory extends React.Component {
7979
isDisabled={boolean('isDisabled', false)}
8080
isMulti={isMulti}
8181
isSearchable={boolean('isSearchable', true)}
82-
maxMenuHeight={number('maxMenuHeight', 200)}
82+
maxMenuHeight={number('maxMenuHeight', 220)}
8383
name={text('name', 'form-field-name')}
8484
onBlur={action('onBlur')}
8585
onChange={(event, info) => {

src/components/inputs/creatable-select-input/creatable-select-input.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ storiesOf('Components|Inputs', module)
111111
isDisabled={boolean('isDisabled', false)}
112112
isMulti={isMulti}
113113
isSearchable={boolean('isSearchable', true)}
114-
maxMenuHeight={number('maxMenuHeight', 200)}
114+
maxMenuHeight={number('maxMenuHeight', 220)}
115115
name={text('name', 'form-field-name')}
116116
onBlur={action('onBlur')}
117117
onChange={(event, ...args) => {

src/components/inputs/select-input/select-input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class SelectInput extends React.Component {
2727
static isTouched = touched => Boolean(touched);
2828

2929
static defaultProps = {
30-
maxMenuHeight: 200,
30+
maxMenuHeight: 220,
3131
};
3232

3333
static propTypes = {

src/components/inputs/select-input/select-input.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ storiesOf('Components|Inputs', module)
114114
isDisabled={boolean('isDisabled', false)}
115115
isMulti={isMulti}
116116
isSearchable={boolean('isSearchable', false)}
117-
maxMenuHeight={number('maxMenuHeight', 200)}
117+
maxMenuHeight={number('maxMenuHeight', 220)}
118118
name={text('name', 'form-field-name')}
119119
onBlur={action('onBlur')}
120120
onChange={(event, ...args) => {

src/components/inputs/select-input/select-input.visualroute.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@ import { Route, Switch } from 'react-router-dom';
33
import { SelectInput } from 'ui-kit';
44
import { Suite, Spec } from '../../../../test/percy';
55

6-
const options = [
6+
const defaultOptions = [
77
{ value: 'one', label: 'One' },
88
{ value: 'two', label: 'Two' },
99
];
1010

11+
const longOptions = defaultOptions.concat([
12+
{ value: 'three', label: 'Three' },
13+
{ value: 'four', label: 'Four' },
14+
{ value: 'five', label: 'Five' },
15+
{ value: 'six', label: 'Six' },
16+
{ value: 'seven', label: 'Seven' },
17+
{ value: 'eight', label: 'Eight' },
18+
]);
19+
20+
const options = defaultOptions;
21+
1122
const optionsWithGroups = [
12-
{ label: 'one', options: [{ value: 'one', label: 'One' }] },
13-
{ options: [{ value: 'two', label: 'Two' }] },
23+
{ label: 'animals', options: [{ value: 'cats', label: 'Cats' }] },
24+
{ options: longOptions },
1425
];
1526

1627
const value = 'one';
@@ -102,7 +113,7 @@ const OpenRoute = () => (
102113
id="select-input"
103114
value={value}
104115
onChange={() => {}}
105-
options={options}
116+
options={longOptions}
106117
horizontalConstraint="m"
107118
/>
108119
</Spec>

src/components/internals/create-select-styles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const groupHeadingStyles = () => base => ({
178178
textTransform: 'none',
179179
fontWeight: 'bold',
180180
margin: `0 ${vars.spacing4}`,
181-
padding: `${vars.spacing8} ${vars.spacing4} ${vars.spacing4}`,
181+
padding: `${vars.spacing8} ${vars.spacing4}`,
182182
'&:empty': {
183183
padding: 0,
184184
},

0 commit comments

Comments
 (0)