diff --git a/Sources/Sliders/Joystick.swift b/Sources/Sliders/Joystick.swift index 9f25438..1aa61a2 100644 --- a/Sources/Sliders/Joystick.swift +++ b/Sources/Sliders/Joystick.swift @@ -290,7 +290,7 @@ public struct Joystick: View { struct JoyStickKey: PreferenceKey { static var defaultValue: [Int:Anchor] { [:] } static func reduce(value: inout [Int:Anchor], nextValue: () -> [Int:Anchor]) { - value = nextValue() + value.merge(nextValue(), uniquingKeysWith: {$1}) } } @Environment(\.joystickStyle) private var style: AnyJoystickStyle