Skip to content

Commit 80ef6e7

Browse files
committed
refactor: 增加只读禁用逻辑
1 parent 62e6fc6 commit 80ef6e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export function init(id, invoke, method) {
5050
if (e.clipboardData && e.clipboardData.getData) {
5151
const pastedText = e.clipboardData.getData('text/plain');
5252
const inputs = [...el.querySelectorAll('.bb-opt-item')];
53+
if (inputs.find(i => i.getAttribute('disabled') || i.getAttribute('readonly'))) {
54+
return;
55+
}
5356
for (const index in inputs) {
5457
const input = inputs[index];
5558
if (index < pastedText.length) {

0 commit comments

Comments
 (0)