Skip to content

table组件的搜索器demo存在某些特殊用例,该用例下代码无法正常工作 #3257

@arika163

Description

@arika163
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.7.2

Environment

任意环境均可复现

Reproduction link

Edit on CodeSandbox

Steps to reproduce

已提供沙盒复现,仅针对官方demo修改了了表中address一栏的数据,请尝试在地址一栏中输入以下字符串执行搜索
\w
^a
.$
[xyz]

What is expected?

正常搜索,并正常高亮搜索词条部分

What is actually happening?

可以正常搜索,但是无法高亮。


原因是没有对用户输入的文本中可能被识别成正则表达式的部分进行处理,不知道有没有可靠的三方库可以直接将searchText中的特殊字符全部加上转义

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions