mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Cascader: Do not override default width behavior (#22620)
* Cascader: Do not override default width behavior * Fixed storybook
This commit is contained in:
parent
733450c7b7
commit
917860c4d3
@ -8,6 +8,7 @@ import { FormInputSize } from '../Forms/types';
|
||||
import { Input } from '../Forms/Input/Input';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { css } from 'emotion';
|
||||
|
||||
interface CascaderProps {
|
||||
/** The seperator between levels in the search */
|
||||
separator?: string;
|
||||
@ -184,7 +185,7 @@ export class Cascader extends React.PureComponent<CascaderProps, CascaderState>
|
||||
onChange={this.onSelect}
|
||||
onBlur={this.onBlur}
|
||||
options={searchableOptions}
|
||||
size={size || 'md'}
|
||||
size={size}
|
||||
onCreateOption={this.onCreateOption}
|
||||
formatCreateLabel={this.props.formatCreateLabel}
|
||||
/>
|
||||
@ -205,7 +206,7 @@ export class Cascader extends React.PureComponent<CascaderProps, CascaderState>
|
||||
>
|
||||
<div className={disableDivFocus}>
|
||||
<Input
|
||||
size={size || 'md'}
|
||||
size={size}
|
||||
placeholder={placeholder}
|
||||
value={activeLabel}
|
||||
onKeyDown={this.onInputKeyDown}
|
||||
|
@ -34,6 +34,7 @@ export const basic = () => {
|
||||
<Select
|
||||
placeholder="Choose..."
|
||||
options={options}
|
||||
width={20}
|
||||
onChange={value => {
|
||||
action('onChanged fired')(value);
|
||||
updateValue(value);
|
||||
@ -57,6 +58,7 @@ export const withAllowCustomValue = () => {
|
||||
// value={value}
|
||||
placeholder="Choose..."
|
||||
options={options}
|
||||
width={20}
|
||||
allowCustomValue={true}
|
||||
onChange={value => {
|
||||
action('onChanged fired')(value);
|
||||
@ -87,6 +89,7 @@ export const asyncSelect = () => {
|
||||
<AsyncSelect
|
||||
value={value}
|
||||
defaultOptions
|
||||
width={20}
|
||||
isLoading={isLoading}
|
||||
loadOptions={loadAsyncOptions}
|
||||
onChange={value => {
|
||||
|
Loading…
Reference in New Issue
Block a user