message: feat: Add `focusOnMove` prop to `Composite`
diff: @@ -116,7 +116,7 @@ function useScheduleFocus(activeItem?: Item) {
  * ```
  */
  export const useComposite = createHook<CompositeOptions>(
  - ({ state, composite = true, ...props }) => {
  + ({ state, composite = true, focusOnMove = true, ...props }) => {
  const ref = useRef<HTMLDivElement>(null);
  const virtualFocus = composite && state.virtualFocus;
  const activeItem = findEnabledItemById(state.items, state.activeId);
  @@ -128,14 +128,15 @@ export const useComposite = createHook<CompositeOptions>(
  // Focus on the active item element.
  useSafeLayoutEffect(() => {
  + if (!focusOnMove) return;
  + if (!state.moves) return;
  const itemElement = activeItemRef.current?.ref.current;
  if (!itemElement) return;
  - if (!state.moves) return;
  // We're scheduling the focus on the next tick to avoid the `onFocus`
  // event on each item to be triggered before the state changes can
  // propagate to them.
  scheduleFocus();
  - }, [state.moves]);
  + }, [focusOnMove, state.moves]);
  useEffect(() => {
  if (!composite) return;
  @@ -418,6 +419,12 @@ export type CompositeOptions<T extends As = "div"> = FocusableOptions<T> & {
  * ```
  */
  composite?: boolean;
  + /**
  + * Whether the active composite item should receive focus when
  + * `composite.move` is called.
  + * @default true
  + */
  + focusOnMove?: boolean;
  };
  export type CompositeProps<T extends As = "div"> = Props<CompositeOptions<T>>;
  