Skip to content

Commit

Permalink
Disable text selection notifications in kbwebview
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Dec 11, 2019
1 parent 2317796 commit 1691fca
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Blink/SmarterKeys/SmarterTermInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,22 @@ class SmarterTermInput: KBWebView {
_kbView.isHidden = false
_kbView.invalidateIntrinsicContentSize()
refreshInputViews()

_disableTextSelectionView()
return res == true
}

private func _disableTextSelectionView() {
let subviews = scrollView.subviews
guard
subviews.count > 2,
let v = subviews[1].subviews.first
else {
return
}
NotificationCenter.default.removeObserver(v)
}

var isRealFirstResponder: Bool {
contentView()?.isFirstResponder == true
}
Expand Down

0 comments on commit 1691fca

Please sign in to comment.