react-fonticonpicker icon indicating copy to clipboard operation
react-fonticonpicker copied to clipboard

can not open dropdown with ref its automatic close

Open umairmanzoor1143 opened this issue 2 years ago • 0 comments

codeSandBox: https://codesandbox.io/s/icon-picker-cfldkf?file=/src/App.js code: `import FontIconPicker from "@fonticonpicker/react-fonticonpicker"; import "@fonticonpicker/react-fonticonpicker/dist/fonticonpicker.base-theme.react.css"; import "@fonticonpicker/react-fonticonpicker/dist/fonticonpicker.material-theme.react.css"; import React, { useRef, useState } from "react";

const IconPicker = () => { const [icon, setIcon] = useState(); const fontIconPickerRef = useRef(null); const handleChange = (i) => { setIcon(i); };

const handleCustomClick = () => { if (fontIconPickerRef.current) { fontIconPickerRef.current.handleDropDown(true); } }; console.log(fontIconPickerRef); return (

<div onClick={handleCustomClick}>click
<FontIconPicker icons={[ "fipicon-angle-left", "fipicon-angle-right", "fipicon-angle-up", "fipicon-angle-down" ]} ref={fontIconPickerRef} renderFunc={(svg) => <i className={svg}>} theme="bluegrey" appendTo="body" renderUsing="class" iconsPerPage={20} value={icon} onChange={handleChange} isMulti={false} /> ); };

export default IconPicker; `

umairmanzoor1143 avatar Aug 23 '23 13:08 umairmanzoor1143