Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const comboBox = Machine(
- {
- id: 'combobox',
- context: {
- value: '',
- highlightedIndex: 0,
- items: ['hello'],
- matchedItems: [],
- },
- initial: 'idle',
- states: {
- idle: {
- on: {
- FOCUS: 'focused',
- },
- },
- focused: {
- type: 'parallel',
- states: {
- editing: {
- on: {
- CHANGE: {
- target: 'editing',
- actions: 'change',
- },
- BLUR: '#combobox.complete',
- },
- },
- suggesting: {
- initial: 'idle',
- states: {
- idle: {
- on: {
- CHANGE: 'navigating'
- },
- },
- navigating: {
- on: {
- NAVIGATE: 'navigating',
- SELECT: 'idle',
- EMPTY: 'idle',
- },
- },
- },
- },
- },
- },
- complete: {},
- },
- },
- {
- actions: {
- //change: assign(),
- change: () => {}
- },
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement