Skip to content

Commit

Permalink
Disable onMenuOpen in interview for now
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed May 17, 2024
1 parent 73a5f1c commit 4878a6a
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'
import classNames from 'classnames'
import { isEmpty, isNil } from 'lodash'
import { useDebouncedCallback } from 'use-debounce'
import { convert } from 'html-to-text'
// import { convert } from 'html-to-text'

import ProjectApi from '../../../api/ProjectApi'
import projectId from '../../../utils/projectId'
Expand All @@ -22,12 +22,12 @@ import OptionText from './common/OptionText'
const SelectInput = ({ question, value, options, disabled, creatable, updateValue, buttons }) => {

const [inputValue, setInputValue] = useState('')
const [isOpen, setIsOpen] = useState(false)
// const [isOpen, setIsOpen] = useState(false)

const handleChange = (option) => {
if (isNil(option)) {
// close the select input when the value is reset
setIsOpen(false)
// setIsOpen(false)
setInputValue('')

updateValue(value, {})
Expand Down Expand Up @@ -98,15 +98,15 @@ const SelectInput = ({ question, value, options, disabled, creatable, updateValu
inputValue: inputValue,
onInputChange: setInputValue,
onChange: handleChange,
menuIsOpen: isOpen,
onMenuOpen: () => {
setIsOpen(true)
if (valueOption) {
// replace the text shown in the select input with a plain text version
setInputValue(convert(valueOption.text))
}
},
onMenuClose: () => setIsOpen(false),
// menuIsOpen: isOpen,
// onMenuOpen: () => {
// setIsOpen(true)
// if (valueOption) {
// // replace the text shown in the select input with a plain text version
// setInputValue(convert(valueOption.text))
// }
// },
// onMenuClose: () => setIsOpen(false),
getOptionValue: (option) => option.id,
getOptionLabel: (option) => option.text,
formatOptionLabel: (option) => (
Expand Down

0 comments on commit 4878a6a

Please sign in to comment.