Skip to content

Commit 9b1ee59

Browse files
fix(OpenUI5Support): override default [popover] styles (#12301)
* fix(OpenUI5Support): override default [popover] styles * chore: make selector more specific
1 parent 4381cb0 commit 9b1ee59

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[data-sap-ui-popup][popover] {
2+
border: none;
3+
overflow: visible;
4+
margin: 0;
5+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { hasStyle, createStyle } from "../ManagedStyles.js";
2+
import openUI5PopupStyles from "../generated/css/OpenUI5PopupStyles.css.js";
3+
4+
const insertOpenUI5PopupStyles = () => {
5+
if (!hasStyle("data-ui5-popup-styles")) {
6+
createStyle(openUI5PopupStyles, "data-ui5-popup-styles");
7+
}
8+
};
9+
10+
export default insertOpenUI5PopupStyles;

packages/base/src/features/patchPopup.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// OpenUI5's Control.js subset
22
import getSharedResource from "../getSharedResource.js";
3+
import insertOpenUI5PopupStyles from "./insertOpenUI5PopupStyles.js";
34

45
type Control = {
56
getDomRef: () => HTMLElement | null,
@@ -137,6 +138,7 @@ const createGlobalStyles = () => {
137138
};
138139

139140
const patchPopup = (Popup: OpenUI5Popup) => {
141+
insertOpenUI5PopupStyles();
140142
patchOpen(Popup); // Popup.prototype.open
141143
patchClosed(Popup); // Popup.prototype._closed
142144
createGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)

0 commit comments

Comments
 (0)