fix: emoji display
This commit is contained in:
@@ -19,6 +19,13 @@ const ReactionPicker: FC<Props> = ({ mid, hidePicker }) => {
|
|||||||
const handleReact = (emoji: string) => {
|
const handleReact = (emoji: string) => {
|
||||||
reactMessage({ mid, action: emoji });
|
reactMessage({ mid, action: emoji });
|
||||||
hidePicker();
|
hidePicker();
|
||||||
|
// scroll in to view
|
||||||
|
const el = document.querySelector(`[data-msg-mid='${mid}']`);
|
||||||
|
// console.log("eee", el);
|
||||||
|
if (el) {
|
||||||
|
el.scrollIntoViewIfNeeded(false);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className="z-[999]">
|
<div className="z-[999]">
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// scrollIntoViewIfNeeded
|
||||||
|
const isSupported = "scrollIntoViewIfNeeded" in Element.prototype;
|
||||||
|
if (!isSupported) {
|
||||||
|
Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded = true) {
|
||||||
|
const el = this;
|
||||||
|
new IntersectionObserver(function ([entry]) {
|
||||||
|
const ratio = entry.intersectionRatio;
|
||||||
|
if (ratio < 1) {
|
||||||
|
let place = ratio <= 0 && centerIfNeeded ? "center" : "nearest";
|
||||||
|
el.scrollIntoView({
|
||||||
|
block: place,
|
||||||
|
inline: place
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.disconnect();
|
||||||
|
}).observe(this);
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ import ReduxRoutes from "./routes";
|
|||||||
import NewVersion from "./common/component/NewVersion";
|
import NewVersion from "./common/component/NewVersion";
|
||||||
// import i18n (needs to be bundled ;))
|
// import i18n (needs to be bundled ;))
|
||||||
import './i18n';
|
import './i18n';
|
||||||
|
import './common/polyfills';
|
||||||
import { isDarkMode } from './common/utils';
|
import { isDarkMode } from './common/utils';
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
|
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
|
||||||
|
|||||||
Vendored
+3
@@ -42,5 +42,8 @@ export declare global {
|
|||||||
interface WindowEventMap {
|
interface WindowEventMap {
|
||||||
beforeinstallprompt: BeforeInstallPromptEvent;
|
beforeinstallprompt: BeforeInstallPromptEvent;
|
||||||
}
|
}
|
||||||
|
interface Element {
|
||||||
|
scrollIntoViewIfNeeded?: any;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
export type ShareScreenTrack = ILocalVideoTrack | [ILocalVideoTrack, ILocalAudioTrack];
|
export type ShareScreenTrack = ILocalVideoTrack | [ILocalVideoTrack, ILocalAudioTrack];
|
||||||
|
|||||||
Reference in New Issue
Block a user