-
Notifications
You must be signed in to change notification settings - Fork 265
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: apply size "compact" for StaticArea items #1204
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great, exactly what we need IMO
packages/base/src/UI5Element.js
Outdated
} | ||
|
||
updateStaticAreaItemContentDensity() { | ||
const staticAreaItem = this.getStaticAreaItemDomRef().host; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it's a bit safer to check for ".host" only if there is staticAreaItemDomRef()
packages/base/src/UI5Element.js
Outdated
const staticAreaItem = this.getStaticAreaItemDomRef().host; | ||
|
||
if (staticAreaItem) { | ||
staticAreaItem.classList.toggle("sapUiSizeCompact", this.isCompact); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: The second parameter is not supported in Internet Explorer or Opera 12 and earlier.
https://www.w3schools.com/jsref/prop_element_classlist.asp
Just verified it, does not work on IE.
Also, this could would better become a function in StaticAreaItem.js and you just call this function from updateStaticAreaItemContentDensity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great. We'll have to find a workaround for IE at least for the most common use cases, but this is related to the whole compact/cozy story, not just this change.
No description provided.