ant-design-blazor/components/input-number/InputNumber.razor
LingDev b71f655449 feat(module: InputNumber): Add long-click and keyboard operation (#1235)
* feat(module: InputNumber): Add long click and keyboard event

1. When hold mouse down button will always trigger the increase or decrease
2. Add event listener to "ArrowUp" and "ArrowDown" key

* feat(module: InputNumber): Add long click and keyboard event

1. When hold mouse down button will always trigger the increase or decrease
2. Add event listener to "ArrowUp" and "ArrowDown" key

* fix null reference exception

Co-authored-by: ElderJames <shunjiey@hotmail.com>
2021-03-31 19:02:58 +08:00

19 lines
1.1 KiB
C#

@namespace AntDesign
@typeparam TValue
@inherits AntInputComponentBase<TValue>
<div class="@ClassMapper.Class" style="@Style" id="@Id">
<div class="ant-input-number-handler-wrap">
<span unselectable="unselectable" role="button" aria-label="Increase Value" class="@GetIconClass("up")" @onmousedown="IncreaseDown" @onmouseup="IncreaseUp">
<Icon Class="ant-input-number-handler-up-inner" Type="up" />
</span>
<span unselectable="unselectable" role="button" aria-label="Decrease Value" class="@GetIconClass("down")" @onmousedown="DecreaseDown" @onmouseup="DecreaseUp">
<Icon Class="ant-input-number-handler-down-inner" Type="down" />
</span>
</div>
<div class="ant-input-number-input-wrap">
<input @ref="Ref" role="spinbutton" aria-valuemin="@Min" aria-valuemax="@Max" autocomplete="off" max="@Max" min="@Min" step="@Step"
aria-valuenow="@CurrentValue" class="ant-input-number-input" @bind="@CurrentValueAsString" @oninput="OnInput" @onkeydown="OnKeyDown" @onfocus="@OnFocus" @onblur="@OnBlurAsync" disabled="@Disabled" />
</div>
</div>