Skip to content

Commit a198bb5

Browse files
rr-maxauthority
authored andcommitted
Fix #713: support <label> for <input type=file> (#715)
1 parent 7f33c04 commit a198bb5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

common/content/buffer.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,9 @@ const Buffer = Module("buffer", {
530530
Buffer.openUploadPrompt(elem);
531531
buffer.lastInputField = elem;
532532
}
533+
else if (elem instanceof HTMLLabelElement && elem.control) {
534+
Buffer.focusElement(elem.control);
535+
}
533536
else {
534537
elem.focus();
535538

@@ -637,6 +640,10 @@ const Buffer = Module("buffer", {
637640
Buffer.openUploadPrompt(elem);
638641
return;
639642
}
643+
else if (elem instanceof HTMLLabelElement && elem.control) {
644+
buffer.followLink(elem.control, where);
645+
return;
646+
}
640647

641648
let ctrlKey = false, shiftKey = false;
642649
switch (where) {

0 commit comments

Comments
 (0)