Skip to content

Files

Latest commit

 

History

History
74 lines (63 loc) · 3.34 KB

TextFields.md

File metadata and controls

74 lines (63 loc) · 3.34 KB

Text Fields

interface TextField extends InputBase, TextInputBase, TextInputDOM, ValueBase<string>, Labelable, TextInputDOMProps, StyleProps {
  icon?: ReactNode,
  isQuiet?: boolean,
  validationTooltip?: ReactNode
}

type TextArea = TextField;

interface SearchField extends TextField {
  onSubmit?: (value: string) => void,
  onClear?: () => void
}

interface SearchWithin extends InputBase, TextInputBase, Labelable, DOMProps, StyleProps {
  // not extending from ValueBase because we want onValueChange instead of onChange
  value?: string,
  defaultValue?: string,
  onValueChange: (value: string) => void,
  onSubmit: (value: string) => void,

  scope?: string,
  defaultScope?: string,
  onScopeChange: (scope: string) => void,
  children: ReactElement<MenuItem> | ReactElement<MenuItem>[],
}

// should this contain a textfield or other input instead of specifically being a textfield?
interface InlineEditor extends TextField {
  onCancel?: () => void
}

Changes (all)

v2 v3 Notes
<Textfield> <TextField>
<Textarea> <TextArea>
quiet isQuiet.
disabled isDisabled
required isRequired
invalid validationState="invalid"
readOnly isReadOnly
- icon added
- validationTooltip added
- label added
- labelPosition added
- labelAlign added
- necessityIndicator added

SearchField Changes

v2 v3 Notes
<Search> <SearchField>
onChange(value, e, {from}) (search only) onChange(value) removed from parameter. use onClear instead.
- onClear (search only) added
icon - moved to TextField

SearchWithin Changes

v2 v3 Notes
scopeOptions children