From ad35fbf208370940e0809c607809b15442955b36 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 3 Jul 2018 18:25:33 +0100 Subject: [PATCH] Pull out z-index to the sticker picker As it's not a thing that's necessary for other PersistedElements, only the sticker picker because it has to sit above the ContextMenu it sits in. --- src/components/views/elements/PersistedElement.js | 6 +----- src/components/views/rooms/Stickerpicker.js | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/views/elements/PersistedElement.js b/src/components/views/elements/PersistedElement.js index 23dea3499c..6816b4dab3 100644 --- a/src/components/views/elements/PersistedElement.js +++ b/src/components/views/elements/PersistedElement.js @@ -34,9 +34,6 @@ function getOrCreateContainer(containerId) { return container; } -// Greater than that of the ContextualMenu -const PE_Z_INDEX = 5000; - /* * Class of component that renders its children in a separate ReactDOM virtual tree * in a container element appended to document.body. @@ -104,12 +101,11 @@ export default class PersistedElement extends React.Component { left: parentRect.left + 'px', width: parentRect.width + 'px', height: parentRect.height + 'px', - zIndex: PE_Z_INDEX, }); } render() { - const content =
+ const content =
{this.props.children}
; diff --git a/src/components/views/rooms/Stickerpicker.js b/src/components/views/rooms/Stickerpicker.js index 343d04d24b..d6afc28dad 100644 --- a/src/components/views/rooms/Stickerpicker.js +++ b/src/components/views/rooms/Stickerpicker.js @@ -27,6 +27,10 @@ import WidgetUtils from '../../../utils/WidgetUtils'; const widgetType = 'm.stickerpicker'; +// We sit in a context menu, so the persisted element container needs to float +// above it, so it needs a greater z-index than the ContextMenu +const STICKERPICKER_Z_INDEX = 5000; + export default class Stickerpicker extends React.Component { constructor(props) { super(props); @@ -211,7 +215,7 @@ export default class Stickerpicker extends React.Component { width: this.popoverWidth, }} > - +