Skip to content

Two inputs are rendered instead of one #109

@kolkol69

Description

@kolkol69

I'm having a problem with two inputs are rendered in one window, any help would be appreciated

Code used to render input:

import React from 'react'
import ReactFilterBox, { SimpleResultProcessing } from 'react-filter-box'

import 'react-filter-box/lib/react-filter-box.css'

const options = [
  {
    columnField: 'Name',
    type: 'text',
  },
  {
    columnField: 'Description',
    type: 'text',
  },
  {
    columnField: 'Status',
    type: 'selection', // when using type selection, it will automatically sugest all posible values
  },
  {
    columnText: 'Email @',
    columnField: 'Email',
    type: 'text',
  },
]
const TagFilter = () => {
  const [data, setData] = React.useState([])

  const onParseOk = (expressions: any) => {
    const newData = new SimpleResultProcessing(options).process(data, expressions)
    setData(newData)
    // your new data here, which is filtered out of the box by SimpleResultProcessing
  }

  return (
    <div className="main-container">
      <ReactFilterBox
        data={data}
        options={options}
        onParseOk={onParseOk}
      />
    </div>
  )
}

export default TagFilter

Two CodeMirror elements instead of one
screenshot-2023-02-10 at 12 28 31

Gif showing the behaviour of the bug
screenshot-2023-02-10 at 12 29 36

Code sandbox presenting the issue:
https://codesandbox.io/s/confident-cherry-e92zld?file=/src/App.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions