Don't react to keyboard events when the focus is on editable inputs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
goog.provide('ol.interaction.ConditionType');
|
||||
goog.provide('ol.interaction.condition');
|
||||
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('goog.functions');
|
||||
|
||||
|
||||
@@ -75,3 +76,16 @@ ol.interaction.condition.shiftKeyOnly = function(browserEvent) {
|
||||
!browserEvent.platformModifierKey &&
|
||||
browserEvent.shiftKey);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {goog.events.BrowserEvent} browserEvent Browser event.
|
||||
* @return {boolean} True if the target element is not editable.
|
||||
*/
|
||||
ol.interaction.condition.targetNotEditable = function(browserEvent) {
|
||||
var tagName = browserEvent.target.tagName;
|
||||
return (
|
||||
tagName !== goog.dom.TagName.INPUT &&
|
||||
tagName !== goog.dom.TagName.SELECT &&
|
||||
tagName !== goog.dom.TagName.TEXTAREA);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user