<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/scrollInputBehavior(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE19scrollInputBehavior_3forQrAA06ScrolleF0V_AA0hE4KindVtF"
  },
  "title" : "scrollInputBehavior(_:for:)"
}
-->

# scrollInputBehavior(_:for:)

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

```
@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

In contrast to [`scrollDisabled(_:)`](/documentation/SwiftUI/View/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)