仅使用文本搜索忽略ANTD SELECT组件中的表情符号
我有ANTD的选择组件,其中选项标签不是文本。选项标签具有文字以及表情符号。现在,如果用户想搜索特定的文本,则选择组件将无法搜索具有表情符号的文本。
我想拥有的是用户应该搜索忽略表情符号的特定文本。
import React from 'react';
import 'antd/dist/antd.css';
import './index.css';
import { Select } from 'antd';
const { Option } = Select;
const App = () => (
<Select
showSearch
style={{
width: 200,
}}
placeholder="Search to Select"
optionFilterProp="children"
filterOption={(input, option) => option.children.includes(input)}
>
<Option value="1"><span>
I have select component of antd where option label is not text. Option label has text along with emoji. Now If user want to search for particular text, the select component is not able to search the text which has emojis.
What I want to have is User should search a particular text ignoring the emoji.
import React from 'react';
import 'antd/dist/antd.css';
import './index.css';
import { Select } from 'antd';
const { Option } = Select;
const App = () => (
<Select
showSearch
style={{
width: 200,
}}
placeholder="Search to Select"
optionFilterProp="children"
filterOption={(input, option) => option.children.includes(input)}
>
<Option value="1"><span>????</span> Not Identified</Option>
<Option value="2"><span>????</span> Closed</Option>
<Option value="3"><span>????</span> Communicated</Option>
<Option value="4"><span>????</span> Identified</Option>
<Option value="5"><span>????</span> Resolved</Option>
<Option value="6"><span>????</span> Cancelled</Option>
</Select>
);
export default App;
If need, I have a codesandbox link.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里只需使用
tolowercase()
字符串函数它的工作我刚刚更新了请检查 codesandbox链接here just use
toLowerCase()
string function it's work i just updated pls check here codesandbox link