🎨 Setting: Set the default value of item.direction (#11214)

This commit is contained in:
Frostime 2024-05-01 15:55:53 +08:00 committed by GitHub
parent e849a73fa5
commit 2770bb3126
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,6 +49,9 @@ export class Setting {
actionElement = item.createActionElement();
}
const tagName = actionElement?.classList.contains("b3-switch")?"label":"div";
if (item.direction === undefined) {
item.direction = ["TEXTAREA"].includes(actionElement.tagName) ? 'row' : 'column';
}
if (item.direction === "row") {
html = `<${tagName} class="b3-label">
<div class="fn__block">