summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-01-20 23:08:16 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-01-22 10:53:59 +0100
commitb0d587dff85c404b83e0f5d1b8356d3b9535f3b5 (patch)
treef240ba0c3f60388fc52378a3587219d441eb9929
parentGet rid of m_canEnableAutoScroll (diff)
downloadrekonq-b0d587dff85c404b83e0f5d1b8356d3b9535f3b5.tar.xz
Consider also editable content
BUG:278056
-rw-r--r--src/webview.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 2c2ea9a6..549c2df3 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -640,9 +640,10 @@ void WebView::keyPressEvent(QKeyEvent *event)
}
const QString tagName = page()->mainFrame()->evaluateJavaScript("document.activeElement.tagName").toString();
-
+ bool isContentEditable = page()->mainFrame()->evaluateJavaScript("document.activeElement.isContentEditable").toBool();
+ kDebug() << "DIT? " << isContentEditable;
// Auto Scrolling
- if (tagName != QL1S("INPUT") && tagName != QL1S("TEXTAREA") && event->modifiers() == Qt::ShiftModifier)
+ if (tagName != QL1S("INPUT") && tagName != QL1S("TEXTAREA") && !isContentEditable && event->modifiers() == Qt::ShiftModifier)
{
kDebug() << "AutoScrolling: " << event->key();
@@ -703,7 +704,7 @@ void WebView::keyPressEvent(QKeyEvent *event)
// vi-like navigation
if (ReKonfig::enableViShortcuts())
{
- if (tagName != QL1S("INPUT") && tagName != QL1S("TEXTAREA") && event->modifiers() == Qt::NoModifier)
+ if (tagName != QL1S("INPUT") && tagName != QL1S("TEXTAREA") && !isContentEditable && event->modifiers() == Qt::NoModifier)
{
kDebug() << "Using VI-LIKE modifiers: " << event->key();