Skip to content

Commit

Permalink
[3578] Fix tooltip and menu visibility in a full screen mode
Browse files Browse the repository at this point in the history
Bug: #3578
Signed-off-by: Denis Nikiforov <denis.nikif@gmail.com>
  • Loading branch information
AresEkb committed Nov 16, 2024
1 parent e98f7ee commit 3938bb8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

=== Bug fixes

- https://github.com/eclipse-sirius/sirius-web/issues/3578[#3578] [diagram] Fix tooltip and menu visibility in a full screen mode


=== New Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export const baseTheme: Theme = createTheme({
},
});

function container() {
return document.fullscreenElement ?? document.body;
}

export const siriusWebTheme = createTheme(
{
components: {
Expand All @@ -79,7 +83,17 @@ export const siriusWebTheme = createTheme(
},
},
},
MuiMenu: {
defaultProps: {
container,
},
},
MuiTooltip: {
defaultProps: {
PopperProps: {
container,
},
},
styleOverrides: {
tooltip: {
backgroundColor: baseTheme.palette.common.black,
Expand Down
14 changes: 14 additions & 0 deletions vscode-extension/src/view/app/theme/siriusWebTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export const baseTheme: Theme = createTheme({
},
});

function container() {
return document.fullscreenElement ?? document.body;
}

export const siriusWebTheme = createTheme(
{
components: {
Expand All @@ -79,7 +83,17 @@ export const siriusWebTheme = createTheme(
},
},
},
MuiMenu: {
defaultProps: {
container,
},
},
MuiTooltip: {
defaultProps: {
PopperProps: {
container,
},
},
styleOverrides: {
tooltip: {
backgroundColor: baseTheme.palette.common.black,
Expand Down

0 comments on commit 3938bb8

Please sign in to comment.