Merge remote-tracking branch 'baidu/master'

This commit is contained in:
2betop 2020-04-23 14:02:15 +08:00
commit 1ea2b78880
2 changed files with 3 additions and 4 deletions

View File

@ -148,8 +148,7 @@ export default class Drawer extends React.Component<DrawerProps, object> {
handleAction(e: React.UIEvent<any>, action: Action, data: object) {
const {onClose, onAction} = this.props;
if (action.actionType === 'close') {
if (action.actionType === 'close' || action.actionType === 'cancel') {
onClose();
} else if (onAction) {
onAction(e, action, data);
@ -642,7 +641,7 @@ export class DrawerRenderer extends Drawer {
const scoped = this.context as IScopedContext;
if (action.actionType === 'close') {
if (action.actionType === 'close' || action.actionType === 'cancel') {
store.setCurrentAction(action);
onClose();
} else if (action.actionType === 'confirm') {

View File

@ -819,7 +819,7 @@ export function highlight(
text = String(text);
const reg = new RegExp(
input.replace(/([\$\^\*\+\-\?\.\(\)\|\[\]\\])/, '\\$1'),
input.replace(/([\$\^\*\+\-\?\.\(\)\|\[\]\\])/g, '\\$1'),
'i'
);
if (!reg.test(text)) {