mirror of
https://github.com/zadam/trilium.git
synced 2025-12-24 00:59:55 +01:00
docs(user): add troubleshooting on content-sized
This commit is contained in:
29
docs/User Guide/!!!meta.json
vendored
29
docs/User Guide/!!!meta.json
vendored
@@ -15775,6 +15775,35 @@
|
||||
"format": "markdown",
|
||||
"dataFileName": "CSS.md",
|
||||
"attachments": []
|
||||
},
|
||||
{
|
||||
"isClone": false,
|
||||
"noteId": "gMkgcLJ6jBkg",
|
||||
"notePath": [
|
||||
"pOsGYCXsbNQG",
|
||||
"CdNpE2pqjmI6",
|
||||
"yIhgI5H7A2Sm",
|
||||
"MgibgPcfeuGz",
|
||||
"gMkgcLJ6jBkg"
|
||||
],
|
||||
"title": "Troubleshooting",
|
||||
"notePosition": 50,
|
||||
"prefix": null,
|
||||
"isExpanded": false,
|
||||
"type": "text",
|
||||
"mime": "text/html",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "label",
|
||||
"name": "shareAlias",
|
||||
"value": "troubleshooting",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
}
|
||||
],
|
||||
"format": "markdown",
|
||||
"dataFileName": "Troubleshooting.md",
|
||||
"attachments": []
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
19
docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Troubleshooting.md
vendored
Normal file
19
docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Troubleshooting.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Troubleshooting
|
||||
## Why is my widget clipped by other UI elements
|
||||
|
||||
For performance and layout reasons, the size of widgets in Trilium is independent from its children. At CSS level, this means that the widget container has `contain: size` applied to it.
|
||||
|
||||
This works well if the widget has a fixed size (or based on its parent container), however to make a widget resize to fit its content, apply the following change:
|
||||
|
||||
```diff
|
||||
class MyWidget extends api.RightPanelWidget {
|
||||
|
||||
+ constructor() {
|
||||
+ super();
|
||||
+ this.contentSized();
|
||||
+ }
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
Alternatively apply `contain: none` to its CSS.
|
||||
Reference in New Issue
Block a user