mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
FIX: rely only on one keyboard computation solution (#21492)
We were combining both solutions which was apparently causing issues from chrome 113 on Android at least. The commit will now use `geometrychange` (android) only when available and fallback to `visualViewport` otherwise (iOS).
This commit is contained in:
parent
55c4a550c1
commit
5b12d23b1d
@ -11,18 +11,20 @@ export default class ChatVh extends Component {
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.setVHFromVisualViewPort();
|
||||
|
||||
(window?.visualViewport || window).addEventListener(
|
||||
"resize",
|
||||
this.setVHFromVisualViewPort
|
||||
);
|
||||
|
||||
if ("virtualKeyboard" in navigator) {
|
||||
this.setVHFromKeyboard();
|
||||
|
||||
navigator.virtualKeyboard.addEventListener(
|
||||
"geometrychange",
|
||||
this.setVHFromKeyboard
|
||||
);
|
||||
} else {
|
||||
this.setVHFromVisualViewPort();
|
||||
|
||||
(window?.visualViewport || window).addEventListener(
|
||||
"resize",
|
||||
this.setVHFromVisualViewPort
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user