How to use the @instructure/ui-utils/lib/createChainedFunction function in @instructure/ui-utils

To help you get started, we’ve selected a few @instructure/ui-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instructure / instructure-ui / packages / ui-menu / src / components / Menu / MenuList / index.js View on Github external
}

      count += 1

      const ref = (node) => {
        if (node) {
          this._menuitems.push(node)
        }
      }

      const props = {
        controls: controls,
        ...child.props.controls, // child 'controls' prop should override parent
        disabled: (disabled || child.props.disabled),
        onFocus: createChainedFunction(this.handleItemFocus, this.props.onFocus),
        onBlur: createChainedFunction(this.handleItemBlur, this.props.onBlur),
        onSelect: this.props.onSelect,
        onMouseOver: this.handleMenuItemMouseOver
      }

      const isTabbable = !this.state.hasFocus && count === 1

      if (matchComponentTypes(child, [MenuItem])) {
        return (
          <li>
            {safeCloneElement(child, {
              ...props,
              tabIndex: isTabbable ? 0 : -1,
              ref,
              key: index
            })}
          </li>
github instructure / instructure-ui / packages / ui-core / src / components / DateInput / index.js View on Github external
'type',
      'messages',
      'defaultValue',
      'value'
    ]
    const textInputProps = pickProps(this.props, omitProps(TextInput.propTypes, {}, ignoredProps))
    const { onChange, onKeyDown, onClick, onBlur } = this.props // eslint-disable-line react/prop-types

    return (
      <span>
        
        
          
            </span>
github instructure / instructure-ui / packages / ui-menu / src / components / Menu / MenuList / index.js View on Github external
return child
      }

      count += 1

      const ref = (node) =&gt; {
        if (node) {
          this._menuitems.push(node)
        }
      }

      const props = {
        controls: controls,
        ...child.props.controls, // child 'controls' prop should override parent
        disabled: (disabled || child.props.disabled),
        onFocus: createChainedFunction(this.handleItemFocus, this.props.onFocus),
        onBlur: createChainedFunction(this.handleItemBlur, this.props.onBlur),
        onSelect: this.props.onSelect,
        onMouseOver: this.handleMenuItemMouseOver
      }

      const isTabbable = !this.state.hasFocus &amp;&amp; count === 1

      if (matchComponentTypes(child, [MenuItem])) {
        return (
          <li>
            {safeCloneElement(child, {
              ...props,
              tabIndex: isTabbable ? 0 : -1,
              ref,
              key: index
            })}</li>
github instructure / instructure-ui / packages / ui-core / src / components / DateInput / index.js View on Github external
'defaultValue',
      'value'
    ]
    const textInputProps = pickProps(this.props, omitProps(TextInput.propTypes, {}, ignoredProps))
    const { onChange, onKeyDown, onClick, onBlur } = this.props // eslint-disable-line react/prop-types

    return (
      <span>
        
        
          
            </span>
github instructure / instructure-ui / packages / ui-core / src / components / DateInput / index.js View on Github external
'messages',
      'defaultValue',
      'value'
    ]
    const textInputProps = pickProps(this.props, omitProps(TextInput.propTypes, {}, ignoredProps))
    const { onChange, onKeyDown, onClick, onBlur } = this.props // eslint-disable-line react/prop-types

    return (
      <span>
        
        
          
            </span>
github instructure / instructure-ui / packages / ui-menu / src / components / Menu / MenuList / index.js View on Github external
const props = omitProps(this.props, MenuList.propTypes)

    return (
      <ul title="{title}" aria-disabled="{disabled" aria-expanded="{show}" aria-controls="{controls}" aria-labelledby="{labelledBy}" aria-hidden="{!show}" tabindex="{this.state.hasFocus" role="menu">
        {this.renderChildren()}
      </ul>
    )
  }
}
github instructure / instructure-ui / packages / ui-core / src / components / Overlay / index.js View on Github external
open={this.state.open}
        role="region"
      &gt;
        {this.props.children}
      
    )

    if (this.props.transition) {
      content = this.renderTransition(content)
    }

    return (
      
        {content}
      
    )
  }
}
github instructure / instructure-ui / packages / ui-core / src / components / Tray / index.js View on Github external
render () {
    const { children, contentRef, open, onOpen, ...props } = this.props
    return (
      
        
           {
              this._content = el
              if (typeof contentRef === 'function') contentRef(el)
            }}
          &gt;
            <dialog role="region" open="{this.state.portalOpen">
              {this.renderCloseButton()}</dialog>
github instructure / instructure-ui / packages / ui-core / src / components / Tray / index.js View on Github external
render () {
    const { children, contentRef, open, onOpen, ...props } = this.props
    return (
      
        
           {
              this._content = el
              if (typeof contentRef === 'function') contentRef(el)
            }}