feat(Search): improve accessibility (#4522)

This commit is contained in:
neverland
2019-09-21 07:34:46 +08:00
committed by GitHub
parent a1ac34bead
commit 890936f61d
4 changed files with 10 additions and 14 deletions
+6 -6
View File
@@ -53,17 +53,17 @@ function Search(
}
function onCancel() {
if (slots.action) {
return;
}
emit(ctx, 'input', '');
emit(ctx, 'cancel');
}
return (
<div class={bem('action')}>
{slots.action ? (
slots.action()
) : (
<div onClick={onCancel}>{props.actionText || t('cancel')}</div>
)}
<div class={bem('action')} role="button" tabindex="0" onClick={onCancel}>
{slots.action ? slots.action() : props.actionText || t('cancel')}
</div>
);
}