Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scene composer): fix overlay arrow clickable space #1780

Merged
merged 3 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ISceneNodeInternal } from '../../../store';
import { sceneComposerIdContext } from '../../../common/sceneComposerIdContext';
import { IAnchorComponentInternal, IDataOverlayComponentInternal } from '../../../store/internalInterfaces';
import { KnownComponentType } from '../../../interfaces';
import { Component } from '../../../models/SceneModels';

import { DataOverlayContainer } from './DataOverlayContainer';

Expand Down Expand Up @@ -42,6 +43,8 @@ export const DataOverlayComponent = ({ node, component }: DataOverlayComponentPr
// TODO: add position after finding proper way to always display overlay right above tag
position={getOffsetFromTag()}
style={{
// top: extra space for the arrow if overlay panel type
top: component.subType == Component.DataOverlaySubType.OverlayPanel ? '-14px' : 'auto',
transform: 'translate3d(-50%,-100%,0)', // make the center of 3D transform the middle of bottom edge
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,13 @@ export const DataOverlayContainer = ({ component, node }: DataOverlayContainerPr
</div>
)}
<DataOverlayRows component={component} />
{subType == Component.DataOverlaySubType.OverlayPanel && (
<div style={tmArrow}>
<div style={{ ...tmContainer, ...tmArrowOuter }} />
<div style={{ ...tmContainer, ...tmArrowOuter, ...tmArrowInner }} />
</div>
)}
</div>

{subType == Component.DataOverlaySubType.OverlayPanel && (
<div style={tmArrow}>
<div style={{ ...tmContainer, ...tmArrowOuter }} />
<div style={{ ...tmContainer, ...tmArrowOuter, ...tmArrowInner }} />
</div>
)}
</>
) : null;
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`DataOverlayComponent should render the component correctly 1`] = `
<div
class="tm-html-wrapper"
data-mocked="Html"
style="transform: translate3d(-50%,-100%,0);"
style="top: -14px; transform: translate3d(-50%,-100%,0);"
>
<div
data-testid="container"
Expand All @@ -28,7 +28,7 @@ exports[`DataOverlayComponent should render the component correctly with object
<div
class="tm-html-wrapper"
data-mocked="Html"
style="transform: translate3d(-50%,-100%,0);"
style="top: -14px; transform: translate3d(-50%,-100%,0);"
>
<div
data-testid="container"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ exports[`DataOverlayContainer should render with panel visible correctly 1`] = `
>
[{"component":{"ref":"comp-ref","type":"DataOverlay","subType":"OverlayPanel","dataRows":[{"rowType":"Markdown","content":"content"}],"valueDataBindings":[]}},{}]
</div>
</div>
<div
style="height: 14px; display: flex; flex-direction: column; align-items: center;"
>
<div
style="overflow: auto; border-radius: 2px; box-shadow: 0px 1px 4px -2px rgba(0, 28, 36, 0.5); width: 18px; height: 18px; position: absolute; z-index: -1; bottom: 5px; transform: rotate(45deg);"
/>
<div
style="overflow: auto; border: 0px; border-radius: 2px; box-shadow: 0px 1px 4px -2px rgba(0, 28, 36, 0.5); width: 20px; height: 20px; position: absolute; z-index: 1; bottom: 6.5px; transform: rotate(45deg);"
/>
style="display: flex; flex-direction: column; align-items: center;"
>
<div
style="overflow: auto; border-radius: 2px; box-shadow: 0px 1px 4px -2px rgba(0, 28, 36, 0.5); width: 18px; height: 18px; position: absolute; z-index: -1; bottom: -9px; transform: rotate(45deg);"
/>
<div
style="overflow: auto; border: 0px; border-radius: 2px; box-shadow: none; width: 20px; height: 20px; position: absolute; z-index: 1; bottom: -7.5px; transform: rotate(45deg);"
/>
</div>
</div>
</div>
`;
Expand All @@ -61,16 +61,16 @@ exports[`DataOverlayContainer should render with panel visible correctly when th
>
[{"component":{"ref":"comp-ref","type":"DataOverlay","subType":"OverlayPanel","dataRows":[{"rowType":"Markdown","content":"content"}],"valueDataBindings":[]}},{}]
</div>
</div>
<div
style="height: 14px; display: flex; flex-direction: column; align-items: center;"
>
<div
style="overflow: auto; border-radius: 2px; box-shadow: 0px 1px 4px -2px rgba(0, 28, 36, 0.5); width: 18px; height: 18px; position: absolute; z-index: -1; bottom: 5px; transform: rotate(45deg);"
/>
<div
style="overflow: auto; border: 0px; border-radius: 2px; box-shadow: 0px 1px 4px -2px rgba(0, 28, 36, 0.5); width: 20px; height: 20px; position: absolute; z-index: 1; bottom: 6.5px; transform: rotate(45deg);"
/>
style="display: flex; flex-direction: column; align-items: center;"
>
<div
style="overflow: auto; border-radius: 2px; box-shadow: 0px 1px 4px -2px rgba(0, 28, 36, 0.5); width: 18px; height: 18px; position: absolute; z-index: -1; bottom: -9px; transform: rotate(45deg);"
/>
<div
style="overflow: auto; border: 0px; border-radius: 2px; box-shadow: none; width: 20px; height: 20px; position: absolute; z-index: 1; bottom: -7.5px; transform: rotate(45deg);"
/>
</div>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const tmCloseButton: CSSProperties = {

// Overlay panel arrow
export const tmArrow: CSSProperties = {
height: '14px',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
Expand All @@ -53,13 +52,14 @@ export const tmArrowOuter: CSSProperties = {
height: '18px',
position: 'absolute',
zIndex: -1,
bottom: '5px',
bottom: '-9px',
transform: 'rotate(45deg)',
};
export const tmArrowInner: CSSProperties = {
border: '0px',
bottom: '6.5px',
bottom: '-7.5px',
width: '20px',
height: '20px',
zIndex: '1',
boxShadow: 'none',
};
Loading