Skip to content

Commit 57348c8

Browse files
authored
[MOO-2018]: fix the visibility of lable position option for mx10 (#460)
2 parents 65a71f1 + 1c5f2e1 commit 57348c8

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

packages/pluggableWidgets/switch-native/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1515
- We fixed an issue where the validation message was rendered inside the view container of the switch, which caused incorrect styling of the switch.
1616
- Fixed an issue where two overlapping tracks were seen in IOS, giving a inconsistent look to switch.
1717

18-
1918
## [1.1.0] - 2024-12-3
2019

2120
### Changed

packages/pluggableWidgets/switch-native/src/Switch.editorConfig.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ export function getPreview(values: SwitchPreviewProps, isDarkMode: boolean): Str
2424
document: decodeURIComponent(
2525
(isDarkMode ? StructurePreviewSwitchDarkSVG : StructurePreviewSwitchSVG).replace("data:image/svg+xml,", "")
2626
),
27-
width: 80,
27+
width: 51,
2828
height: 30,
2929
grow: 8
3030
};
31-
const children = values.showLabel ? [label, image] : [image];
32-
31+
const children = values.showLabel ? (values.labelPosition === "right" ? [image, label] : [label, image]) : [image];
3332
return values.labelOrientation === "horizontal"
3433
? {
3534
type: "RowLayout",
@@ -48,7 +47,11 @@ export function getPreview(values: SwitchPreviewProps, isDarkMode: boolean): Str
4847

4948
export function getProperties(values: SwitchPreviewProps, defaultProperties: Properties): Properties {
5049
if (!values.showLabel) {
51-
hidePropertiesIn(defaultProperties, values, ["label", "labelOrientation"]);
50+
hidePropertiesIn(defaultProperties, values, ["label", "labelOrientation", "labelPosition"]);
51+
}
52+
53+
if (values.showLabel && values.labelOrientation !== "horizontal") {
54+
hidePropertiesIn(defaultProperties, values, ["labelPosition"]);
5255
}
5356

5457
return defaultProperties;

0 commit comments

Comments
 (0)