---
title: "scrollInputBehavior(_:for:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/scrollinputbehavior(_:for:)"
---

# scrollInputBehavior(_:for:)

Enables or disables scrolling in scrollable views when using particular inputs.

## Declaration

```swift
@MainActor @preconcurrency func scrollInputBehavior(_ behavior: ScrollInputBehavior, for input: ScrollInputKind) -> some View

```

## Parameters

- `behavior`: Whether scrolling should be enabled or disabled for this input.
- `input`: The input for which to enable or disable scrolling.

## Discussion

Discussion In contrast to scrollDisabled(_:), this modifier will enable or disable scrolling only for particular inputs. The following, for instance, disables double-tap-to-scroll on watchOS while preserving the ability to scroll via touch and the Digital Crown: ScrollView(...)     .scrollInputBehavior(.disabled, for: .handGestureShortcut) If scrollDisabled(true) has been applied to this view, scrolling will be disabled for all inputs and this modifier cannot be used to re-enable scrolling.

## See Also

### Managing scrolling for different inputs

- [ScrollInputKind](swiftui/scrollinputkind.md)
- [ScrollInputBehavior](swiftui/scrollinputbehavior.md)
