From 97584af9478d469096ba3d4afb30f8768b4b2624 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 4 Feb 2021 02:50:54 -0700 Subject: [PATCH] Fix z-index of stickerpicker --- src/components/views/elements/PersistedElement.js | 6 +++++- src/components/views/rooms/Stickerpicker.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/PersistedElement.js b/src/components/views/elements/PersistedElement.js index 07b01cb03f..3732f644b8 100644 --- a/src/components/views/elements/PersistedElement.js +++ b/src/components/views/elements/PersistedElement.js @@ -23,6 +23,7 @@ import ResizeObserver from 'resize-observer-polyfill'; import dis from '../../../dispatcher/dispatcher'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; +import {isNullOrUndefined} from "matrix-js-sdk/src/utils"; // Shamelessly ripped off Modal.js. There's probably a better way // of doing reusable widgets like dialog boxes & menus where we go and @@ -61,6 +62,9 @@ export default class PersistedElement extends React.Component { // Any PersistedElements with the same persistKey will use // the same DOM container. persistKey: PropTypes.string.isRequired, + + // z-index for the element. Defaults to 9. + zIndex: PropTypes.number, }; constructor() { @@ -165,7 +169,7 @@ export default class PersistedElement extends React.Component { const parentRect = parent.getBoundingClientRect(); Object.assign(child.style, { - zIndex: 9, + zIndex: isNullOrUndefined(this.props.zIndex) ? 9 : this.props.zIndex, position: 'absolute', top: parentRect.top + 'px', left: parentRect.left + 'px', diff --git a/src/components/views/rooms/Stickerpicker.js b/src/components/views/rooms/Stickerpicker.js index 0b81f82721..5446d15671 100644 --- a/src/components/views/rooms/Stickerpicker.js +++ b/src/components/views/rooms/Stickerpicker.js @@ -264,7 +264,7 @@ export default class Stickerpicker extends React.Component { width: this.popoverWidth, }} > - +