Skip to content

Commit f22f0b8

Browse files
committed
refactor: 禁用模式下不显示 Clear 按钮
1 parent f44f296 commit f22f0b8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/BootstrapBlazor/Components/Input/BootstrapInput.razor

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
{
1212
<div class="bb-clearable-input">
1313
@RenderInput
14-
<i class="@ClearableIconString" @onclick="OnClickClear"></i>
14+
@if (!IsDisabled && !Readonly)
15+
{
16+
<i class="@ClearableIconString" @onclick="OnClickClear"></i>
17+
}
1518
</div>
1619
}
1720
else

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function handleKeyUp(id, invoke, enter, enterCallbackMethod, esc, escCall
1111
const el = document.getElementById(id)
1212
if (el) {
1313
EventHandler.on(el, 'keyup', e => {
14-
if (enter && e.key === 'Enter') {
14+
if (enter && (e.key === 'Enter' || e.key === 'NumpadEnter')) {
1515
invoke.invokeMethodAsync(enterCallbackMethod, el.value)
1616
}
1717
else if (esc && e.key === 'Escape') {

0 commit comments

Comments
 (0)