File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/dev/sharedUiComponents/src/fluent/hoc/propertyLines Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,10 @@ export const QuaternionPropertyLine: FunctionComponent<QuaternionPropertyLinePro
167167 const max = props . useDegrees ? 360 : undefined ;
168168 const [ quat , setQuat ] = useState ( props . value ) ;
169169
170+ useEffect ( ( ) => {
171+ setQuat ( props . value ) ;
172+ } , [ props . value ] ) ;
173+
170174 // Extract only the properties that exist on QuaternionPropertyLineProps
171175 const { useDegrees, ...restProps } = props ;
172176
@@ -177,8 +181,7 @@ export const QuaternionPropertyLine: FunctionComponent<QuaternionPropertyLinePro
177181
178182 const onEulerChange = ( val : Vector3 ) => {
179183 const quat = Quaternion . FromEulerAngles ( val . x , val . y , val . z ) ;
180- setQuat ( quat ) ;
181- props . onChange ( quat ) ;
184+ onQuatChange ( quat ) ;
182185 } ;
183186
184187 return useDegrees ? (
@@ -194,7 +197,7 @@ export const QuaternionPropertyLine: FunctionComponent<QuaternionPropertyLinePro
194197 unit = "deg"
195198 />
196199 ) : (
197- < QuaternionPropertyLineInternal { ...props } unit = { "rad" } nullable = { false } value = { quat } min = { min } max = { max } onChange = { onQuatChange } />
200+ < QuaternionPropertyLineInternal { ...props } nullable = { false } value = { quat } min = { min } max = { max } onChange = { onQuatChange } />
198201 ) ;
199202} ;
200203export const Vector2PropertyLine = TensorPropertyLine as FunctionComponent < TensorPropertyLineProps < Vector2 > > ;
You can’t perform that action at this time.
0 commit comments