Do not force keyboard text navigation in editable elements

Keyboard text navigation is handled automatically by QtWebKit
in editable elements.
This fixes issue in some custom html code editors.

Closes #1489
remotes/origin/falkon
David Rosca 12 years ago
parent ee3322c64a
commit 5404985dba
  1. 6
      src/lib/webkit/webview.cpp

@ -1380,6 +1380,12 @@ void WebView::keyPressEvent(QKeyEvent* event)
}
}
// Text navigation is handled automatically in editable elements
const QString js = QSL("document.activeElement.contentEditable==='true'||typeof document.activeElement.value != 'undefined'");
QWebFrame* frame = page()->currentFrame();
if (frame && frame->evaluateJavaScript(js).toBool())
return QWebView::keyPressEvent(event);
switch (eventKey) {
case Qt::Key_C:
if (event->modifiers() == Qt::ControlModifier) {

Loading…
Cancel
Save