mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
Switch eventTrap from a <div> to an <input>
This prevents the appearance of various 'contextual' entries in a tooltip over the caret in iOS.
This commit is contained in:
@@ -68,7 +68,7 @@ gui.EventManager = function EventManager(odtDocument) {
|
||||
},
|
||||
/**@type{!Object.<string,!EventDelegate>}*/
|
||||
eventDelegates = {},
|
||||
/**@type{!HTMLDivElement}*/
|
||||
/**@type{!HTMLInputElement}*/
|
||||
eventTrap;
|
||||
|
||||
/**
|
||||
@@ -334,7 +334,7 @@ gui.EventManager = function EventManager(odtDocument) {
|
||||
doc = sizerElement.ownerDocument;
|
||||
|
||||
runtime.assert(Boolean(window), "EventManager requires a window object to operate correctly");
|
||||
eventTrap = /**@type{!HTMLDivElement}*/(doc.createElement("div"));
|
||||
eventTrap = /**@type{!HTMLInputElement}*/(doc.createElement("input"));
|
||||
eventTrap.id = "eventTrap";
|
||||
// Negative tab index still allows focus, but removes accessibility by keyboard
|
||||
eventTrap.setAttribute("tabindex", -1);
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=773137
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=787305
|
||||
eventManager.blur();
|
||||
eventTrap.setAttribute("contenteditable", false);
|
||||
eventTrap.setAttribute('disabled', true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -318,7 +318,11 @@
|
||||
// the IME state after the content editable flag has been updated.
|
||||
eventManager.blur();
|
||||
}
|
||||
eventTrap.setAttribute("contenteditable", isEditable);
|
||||
if (isEditable) {
|
||||
eventTrap.removeAttribute('disabled');
|
||||
} else {
|
||||
eventTrap.setAttribute('disabled', true);
|
||||
}
|
||||
if (hasFocus) {
|
||||
eventManager.focus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user