Skip to content

Commit b9d9473

Browse files
committed
refactor: 使用 js 解决问题保证效率
1 parent 8294e39 commit b9d9473

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/BootstrapBlazor/Components/Input/BootstrapInput.razor.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export function handleKeyUp(id, invoke, enter, enterCallbackMethod, esc, escCall
1212
if (el) {
1313
EventHandler.on(el, 'keyup', e => {
1414
if (enter && (e.key === 'Enter' || e.key === 'NumpadEnter')) {
15-
invoke.invokeMethodAsync(enterCallbackMethod, { key: e.key, code: e.code, ctrlKey: e.ctrlKey, shiftKey: e.shiftKey, altKey: e.altKey, metaKey: e.metaKey, repeat: e.repeat, type: e.type, location: e.location }, el.value)
15+
const useShiftEnter = el.getAttribute('data-bb-shift-enter') === 'true';
16+
if (!e.shiftKey && useShiftEnter) {
17+
return;
18+
}
19+
invoke.invokeMethodAsync(enterCallbackMethod, el.value)
1620
}
1721
else if (esc && e.key === 'Escape') {
1822
invoke.invokeMethodAsync(escCallbackMethod)

0 commit comments

Comments
 (0)