1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

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
This commit is contained in:
David Rosca 2014-10-11 11:42:07 +02:00
parent ee3322c64a
commit 5404985dba

View File

@ -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) {