Skip to content

Commit d69d352

Browse files
committed
doc: 更新注释为英语
1 parent 51e5d77 commit d69d352

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

src/BootstrapBlazor/Components/Textarea/Textarea.razor.cs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,47 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6+
using Microsoft.AspNetCore.Components.Web;
7+
68
namespace BootstrapBlazor.Components;
79

810
/// <summary>
9-
/// Textarea 组件
11+
/// Textarea component
1012
/// </summary>
1113
public partial class Textarea
1214
{
1315
/// <summary>
14-
/// 滚动到顶部
16+
/// Scroll to the top
1517
/// </summary>
1618
/// <returns></returns>
1719
public Task ScrollToTop() => InvokeVoidAsync("execute", Id, "toTop");
1820

1921
/// <summary>
20-
/// 滚动到数值
22+
/// Scroll to a specific value
2123
/// </summary>
2224
/// <returns></returns>
2325
public Task ScrollTo(int value) => InvokeVoidAsync("execute", Id, "to", value);
2426

2527
/// <summary>
26-
/// 滚动到底部
28+
/// Scroll to the bottom
2729
/// </summary>
2830
/// <returns></returns>
2931
public Task ScrollToBottom() => InvokeVoidAsync("execute", Id, "toBottom");
3032

3133
/// <summary>
32-
/// 获得/设置 是否自动滚屏 默认 false
34+
/// Gets or sets whether auto-scroll is enabled. Default is false.
3335
/// </summary>
3436
[Parameter]
3537
public bool IsAutoScroll { get; set; }
3638

3739
/// <summary>
38-
/// 获得/设置 是否使用 Shift + Enter 代替原回车按键行为 默认为 false
40+
/// Gets or sets whether Shift + Enter replaces the default Enter key behavior. Default is false.
3941
/// </summary>
4042
[Parameter]
4143
public bool UseShiftEnter { get; set; }
4244

4345
/// <summary>
44-
/// 获得 客户端是否自动滚屏标识
46+
/// Gets the client-side auto-scroll identifier.
4547
/// </summary>
4648
private string? AutoScrollString => IsAutoScroll ? "auto" : null;
4749

@@ -61,4 +63,20 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
6163
await InvokeVoidAsync("execute", Id, "update");
6264
}
6365
}
66+
67+
/// <summary>
68+
/// Client-side EnterCallback method
69+
/// </summary>
70+
/// <returns></returns>
71+
[JSInvokable]
72+
public override async Task EnterCallback(KeyboardEventArgs e, string val)
73+
{
74+
if (OnEnterAsync != null && TriggerEnter(e))
75+
{
76+
CurrentValueAsString = val;
77+
await OnEnterAsync(Value);
78+
}
79+
}
80+
81+
private bool TriggerEnter(KeyboardEventArgs e) => UseShiftEnter ? e.ShiftKey : true;
6482
}

0 commit comments

Comments
 (0)