How to use the react-select.createFilter function in react-select

To help you get started, we’ve selected a few react-select 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 rohan-paul / stock-dashboard-react / src / Components / StockAnalytics / StockAnalyticsDashBoard-WITH-HUGER-autosuggestion.js View on Github external
input: base => ({
        ...base,
        color: theme.palette.text.primary,
        "& input": {
          font: "inherit"
        }
      })
    };

    return (
      
        {console.log("TICKER IS", this.state.stockTicker)}
        <div style="{{">
          <select value="{this.state.stockTicker}" list="">
        

        
          
            
              Selected Stock
            
          
</select></div>
github rohan-paul / stock-dashboard-react / src / Components / StockAnalytics / StockAnalyticsDashBoard.js View on Github external
}
      })
    };

    return (
      
        {console.log("CLOSING PRICE ", this.state.yAxisData_StockClosingPrice)}
        
          
            <div>
              <div>
                <select value="{this.state.stockTicker}" list="">
              
              
                
                    value
                      ? [
                          /\d/,
                          /\d/,
                          "/",</select></div></div>
github rohan-paul / stock-dashboard-react / src / Components / StockAnalytics / Alternative-working-codes-kept-for-backup / StockAnalyticsDashBoard-WITH-HUGE-autosuggestion.js View on Github external
font: "inherit"
        }
      })
    };

    return (
      
        
          
            <div>
              <div>
                <select value="{this.state.stockTicker}" list="">
              
              
                
                    value
                      ? [
                          /\d/,
                          /\d/,
                          "/",</select></div></div>
github elifesciences / elife-xpub / packages / component-submission / client / components / SubjectAreaDropdown.js View on Github external
const selectChildProps = {
      components: {
        ClearIndicator: null,
        IndicatorSeparator: null,
        MultiValueRemove: TagRemovalIcon,
      },
      id: 'subject-area-container',
      inputId: 'subject-area-select',
      isMulti: true,
      name,
      onBlur,
      onChange: this.handleChange,
      options: eLifeOptions,
      styles: this.customReactSelectStyles,
      value: selectedOptions,
      filterOption: createFilter({
        matchFrom: 'start',
      }),
    }

    return (
      
        {/* htmlFor matches with react-select's inputId, which applies the correct id to the internal sub-component */}
        {/* eslint-disable-next-line jsx-a11y/label-has-for */}
        <label>
          {label}
          {isOptional &amp;&amp; ' (optional)'}
        </label>
        {!hasReachedMultiselectLimit &amp;&amp; <select>}
        {hasReachedMultiselectLimit &amp;&amp; (
          
            </select>
github man-group / dtale / static / popups / correlations / CorrelationsGrid.jsx View on Github external
correlations: filterData(filterState, correlations),
      });
    };
    return (
      <div>
        <select> _.toLower(o.value))}
          getOptionLabel={_.property("value")}
          getOptionValue={_.property("value")}
          value={this.state[prop]}
          onChange={onChange}
          noOptionsText={() =&gt; "No columns found"}
          isClearable
          filterOption={createFilter({ ignoreAccents: false })} // required for performance reasons!
        /&gt;
      
    );
  }
</select></div>
github vinay0x / hyperclip / src / components / ClipWindow.jsx View on Github external
render () {
    const options = this.props.clipboardValues &amp;&amp; this.props.clipboardValues.map(
      (value, index) =&gt; {
        const prefix = index &lt; 10 ? ((index != 9) ? `⌘${index + 1} ` : '⌘0 ') : ''
        let label = null
        if (value.length &gt; 75) { label = value.substring(0, 75) + '...' }
        return { label: label || value, value, prefix }
      }
    )
    return (<select placeholder="Search or use arrow keys" value="{"> {
        clipboard.writeText(selected.value)
        sendKeys(selected.value)
        hideWindow()
      } }</select>
github LedgerHQ / ledger-live-desktop / src / components / SelectAccount / index.js View on Github external
style={{
      padding: '0px 6px',
    }}
  &gt;
    
  
)

type Option = {
  matched: 'boolean',
  account: Account | TokenAccount,
}

const getOptionValue = option =&gt; option.account.id

const defaultFilter = createFilter({
  stringify: ({ data: account }) =&gt; {
    const currency = getAccountCurrency(account)
    const name = getAccountName(account)
    return `${currency.ticker}|${currency.name}|${name}`
  },
})
const filterOption = o =&gt; (candidate, input) =&gt; {
  const selfMatches = defaultFilter(candidate, input)
  if (selfMatches) return [selfMatches, true]

  if (candidate.data.type === 'Account' &amp;&amp; o.withSubAccounts) {
    const subAccounts = o.enforceHideEmptySubAccounts
      ? listSubAccounts(candidate.data)
      : candidate.data.subAccounts
    if (subAccounts) {
      for (let i = 0; i &lt; subAccounts.length; i++) {
github kresusapp / kresus / client / components / ui / fuzzy-or-native-select.js View on Github external
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Select, { createFilter } from 'react-select';
import Creatable from 'react-select/creatable';

import { get } from '../../store';
import { assert } from '../../helpers';

const REACT_SELECT_FILTER = createFilter({
    ignoreCase: true,
    ignoreAccents: true,
    trim: true,
    matchFrom: 'any',
    stringify: ({ label }) => label.toString()
});

const FuzzyOrNativeSelect = connect((state, props) => {
    let isSmallScreen = get.isSmallScreen(state);
    return {
        useNativeSelect: isSmallScreen && !props.isMulti,
        isSearchable: !isSmallScreen && props.isSearchable
    };
})(
    class Export extends React.Component {
        handleChange = event => {
github hasura / graphql-engine / console / src / components / Common / SearchableSelect / SearchableSelect.js View on Github external
const getPrefixFilter = () => {
  const prefixFilterOptions = {
    matchFrom: 'start',
  };

  return createFilter(prefixFilterOptions);
};