Skip to content

Commit

Permalink
chore: update tags input
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Mar 21, 2022
1 parent e638ae4 commit a0df702
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/machines/tags-input/src/tags-input.connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export function connect<T extends PropTypes = ReactPropTypes>(

return {
// state
inputValue: state.context.trimmedInputValue,
value: state.context.value,
valueAsString: state.context.valueAsString,
isAtMax: state.context.isAtMax,

// methods
clear() {
Expand Down Expand Up @@ -65,6 +67,7 @@ export function connect<T extends PropTypes = ReactPropTypes>(

inputProps: normalize.input<T>({
"data-part": "input",
maxLength: state.context.maxLength,
id: dom.getInputId(state.context),
value: state.context.inputValue,
autoComplete: "off",
Expand Down
4 changes: 4 additions & 0 deletions packages/machines/tags-input/src/tags-input.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export type ValidateTagOptions = {
}

export type MachineContext = Context<{
/**
* The max length of the input.
*/
maxLength?: number
/**
* The separator used to split/join the tag values.
*/
Expand Down

0 comments on commit a0df702

Please sign in to comment.