From 1c656090d294e9f68eaf554e2532d5639036ed6c Mon Sep 17 00:00:00 2001 From: Marco Eidinger Date: Tue, 7 Nov 2023 09:51:50 -0800 Subject: [PATCH] feat: able to run FioriSwiftUI natively on visionOS SDK (4) making sure that package and its unit test compile on visionOS with Xcode 15.1 beta 2 --- .../FioriSwiftUICore/DataTable/InlineEditingView.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/FioriSwiftUICore/DataTable/InlineEditingView.swift b/Sources/FioriSwiftUICore/DataTable/InlineEditingView.swift index bfc32c3a8..df94982bf 100644 --- a/Sources/FioriSwiftUICore/DataTable/InlineEditingView.swift +++ b/Sources/FioriSwiftUICore/DataTable/InlineEditingView.swift @@ -28,6 +28,14 @@ struct InlineEditingView: View { self._editingText = State(initialValue: dataItem?.text ?? "") self._isValid = State(initialValue: (dataItem?.isValid ?? true, "")) } + + var toolbarItemPlacement: ToolbarItemPlacement { + #if os(visionOS) + return .automatic + #else + return .keyboard + #endif + } var body: some View { let dataItem = self.layoutData.allDataItems[self.rowIndex][self.columnIndex] @@ -109,7 +117,7 @@ struct InlineEditingView: View { .frame(width: cellWidth, height: cellHeight) .border(isValid.0 ? Color.preferredColor(.tintColor) : Color.preferredColor(.negativeLabel), width: 2) .toolbar { - ToolbarItemGroup(placement: .keyboard) { + ToolbarItemGroup(placement: toolbarItemPlacement) { Spacer() Button {