aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/client.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r--ext/fg/js/client.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index 37377984..bb0d3749 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -80,8 +80,15 @@ class Client {
textSourceFromPoint(point) {
const element = document.elementFromPoint(point.x, point.y);
- if (element !== null && element.nodeName === 'IMG') {
- return new TextSourceImage(element);
+ if (element !== null) {
+ switch (element.nodeName) {
+ case 'IMG':
+ return new TextSourceImage(element);
+ case 'INPUT':
+ case 'BUTTON':
+ case 'TEXTAREA':
+ return new TextSourceInput(element);
+ }
}
const range = document.caretRangeFromPoint(point.x, point.y);