Commit b0d587df authored by Andrea Diamantini's avatar Andrea Diamantini
Browse files

Consider also editable content

BUG:278056
parent c4f817ab
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment