Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextInput multiline={true} scrollEnabled={false} not working #925

Open
jbcullis opened this issue Dec 9, 2021 · 4 comments
Open

TextInput multiline={true} scrollEnabled={false} not working #925

jbcullis opened this issue Dec 9, 2021 · 4 comments
Labels
Area: TextInput bug Something isn't working Stale

Comments

@jbcullis
Copy link

jbcullis commented Dec 9, 2021

Environment

react-native 0.64.0:
npm ls react-native-macos: 0.64.13
node: 17.0.1
npm: 8.1.0
yarn: N/A
xcodebuild: 13A1030d

Steps to reproduce the bug

Create a TextInput with multiline={true} and scrollEnabled={false} but the field will still grab the scroll once the mouse hovers over.

Expected Behavior

If scroll is false we should be able to scroll right over the top of it.

Actual Behavior

No response

Reproducible Demo

No response

Additional context

No response

@jbcullis jbcullis added the bug Something isn't working label Dec 9, 2021
@ghost ghost added the Needs: Triage 🔍 label Dec 9, 2021
@HeyImChris
Copy link

Looks like a valid bug we can look into after the 0.66 migration into our fork.

shwanton pushed a commit to shwanton/react-native-macos that referenced this issue Jul 8, 2022
Summary:
# Context

RN iOS supports disabling scrolling via `scrollEnabled` prop for multiline text inputs.
https://reactnative.dev/docs/0.68/textinput#scrollenabled-ios

This does [not work](microsoft#925) on MacOS

Since MacOS does not use `UITextView` which inherits from `UIScrollView`, the view manager property was set but not actually passed down to the underlying scroll view.

`RCTMultilineTextInputView` creates a `RCTUIScrollView` which is where we need to disable scrolling.
https://www.internalfb.com/code/archon_react_native_macos/[fde4113acd89fb13ee11636c48b59eac49c21bae]/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m?lines=31

`RCTUIScrollView` inherits from `NSScrollView` which does not have a `scrollEnabled` property, but there is an api we can use to disable scrolling when the property is set.

https://developer.apple.com/documentation/appkit/nsscrollview/1403494-scrollwheel

# Usage

NOTE: Only works with `multiline={true}`

```
<TextInput multiline={true} scrollEnabled={false} ... />
```

# Change

* Only expose the `scrollEnabled` property on `RCTMultilineTextInputView`.
  * `RCTSinglelineTextInputView` does not have scrolling so this property is unused.
* `RCTMultilineTextInputView` delegates the `scrollEnabled` to it's underlying `_scrollView`
* `RCTUIScrollView` defaults initial `scrollEnabled` to `YES`
* `RCTUIScrollView` disables scrolling when the `scrollEnabled` is `NO`
shwanton pushed a commit to shwanton/react-native-macos that referenced this issue Jul 12, 2022
Summary:
# Context

RN iOS supports disabling scrolling via `scrollEnabled` prop for multiline text inputs.
https://reactnative.dev/docs/0.68/textinput#scrollenabled-ios

This does [not work](microsoft#925) on MacOS

Since MacOS does not use `UITextView` which inherits from `UIScrollView`, the view manager property was set but not actually passed down to the underlying scroll view.

`RCTMultilineTextInputView` creates a `RCTUIScrollView` which is where we need to disable scrolling.
https://www.internalfb.com/code/archon_react_native_macos/[fde4113acd89fb13ee11636c48b59eac49c21bae]/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m?lines=31

`RCTUIScrollView` inherits from `NSScrollView` which does not have a `scrollEnabled` property, but there is an api we can use to disable scrolling when the property is set.

https://developer.apple.com/documentation/appkit/nsscrollview/1403494-scrollwheel

# Usage

NOTE: Only works with `multiline={true}`

```
<TextInput multiline={true} scrollEnabled={false} ... />
```

# Change

* Only expose the `scrollEnabled` property on `RCTMultilineTextInputView`.
  * `RCTSinglelineTextInputView` does not have scrolling so this property is unused.
* `RCTMultilineTextInputView` delegates the `scrollEnabled` to it's underlying `_scrollView`
* `RCTUIScrollView` defaults initial `scrollEnabled` to `YES`
* `RCTUIScrollView` disables scrolling when the `scrollEnabled` is `NO`
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this issue Aug 9, 2022
Summary:
# Context

RN iOS supports disabling scrolling via `scrollEnabled` prop for multiline text inputs.
https://reactnative.dev/docs/0.68/textinput#scrollenabled-ios

This does [not work](microsoft#925) on MacOS

Since MacOS does not use `UITextView` which inherits from `UIScrollView`, the view manager property was set but not actually passed down to the underlying scroll view.

`RCTMultilineTextInputView` creates a `RCTUIScrollView` which is where we need to disable scrolling.
https://www.internalfb.com/code/archon_react_native_macos/[fde4113acd89fb13ee11636c48b59eac49c21bae]/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m?lines=31

`RCTUIScrollView` inherits from `NSScrollView` which does not have a `scrollEnabled` property, but there is an api we can use to disable scrolling when the property is set.

https://developer.apple.com/documentation/appkit/nsscrollview/1403494-scrollwheel

# Usage

NOTE: Only works with `multiline={true}`

```
<TextInput multiline={true} scrollEnabled={false} ... />
```

# Change

* Only expose the `scrollEnabled` property on `RCTMultilineTextInputView`.
  * `RCTSinglelineTextInputView` does not have scrolling so this property is unused.
* `RCTMultilineTextInputView` delegates the `scrollEnabled` to it's underlying `_scrollView`
* `RCTUIScrollView` defaults initial `scrollEnabled` to `YES`
* `RCTUIScrollView` disables scrolling when the `scrollEnabled` is `NO`

Test Plan:
## Zeratul

```
MDSTextInput
        {...textInputProps}
        {...(IS_MAC
          ? {multiline: true, blurOnSubmit: true, scrollEnabled: false}
          : {})} // workaround for T110399243
```

|before|after|
| https://pxl.cl/27gQp|https://pxl.cl/27gQr|

## RN Tester

|before|after|
|https://pxl.cl/27gRd|https://pxl.cl/27gRh|

Reviewers: lyahdav, ericroz, ackchiu, #seller_expansion

Reviewed By: lyahdav

Differential Revision: https://phabricator.intern.facebook.com/D37659010

Tasks: T120776572

Tags: marketplace, marketplace_seller_expansion

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	React/Base/RCTUIKit.h
#	React/Base/macOS/RCTUIKit.m
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this issue Aug 9, 2022
Summary:
# Context

RN iOS supports disabling scrolling via `scrollEnabled` prop for multiline text inputs.
https://reactnative.dev/docs/0.68/textinput#scrollenabled-ios

This does [not work](microsoft#925) on MacOS

Since MacOS does not use `UITextView` which inherits from `UIScrollView`, the view manager property was set but not actually passed down to the underlying scroll view.

`RCTMultilineTextInputView` creates a `RCTUIScrollView` which is where we need to disable scrolling.
https://www.internalfb.com/code/archon_react_native_macos/[fde4113acd89fb13ee11636c48b59eac49c21bae]/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m?lines=31

`RCTUIScrollView` inherits from `NSScrollView` which does not have a `scrollEnabled` property, but there is an api we can use to disable scrolling when the property is set.

https://developer.apple.com/documentation/appkit/nsscrollview/1403494-scrollwheel

# Usage

NOTE: Only works with `multiline={true}`

```
<TextInput multiline={true} scrollEnabled={false} ... />
```

# Change

* Only expose the `scrollEnabled` property on `RCTMultilineTextInputView`.
  * `RCTSinglelineTextInputView` does not have scrolling so this property is unused.
* `RCTMultilineTextInputView` delegates the `scrollEnabled` to it's underlying `_scrollView`
* `RCTUIScrollView` defaults initial `scrollEnabled` to `YES`
* `RCTUIScrollView` disables scrolling when the `scrollEnabled` is `NO`

Test Plan:
## Zeratul

```
MDSTextInput
        {...textInputProps}
        {...(IS_MAC
          ? {multiline: true, blurOnSubmit: true, scrollEnabled: false}
          : {})} // workaround for T110399243
```

|before|after|
| https://pxl.cl/27gQp|https://pxl.cl/27gQr|

## RN Tester

|before|after|
|https://pxl.cl/27gRd|https://pxl.cl/27gRh|

Reviewers: lyahdav, ericroz, ackchiu, #seller_expansion

Reviewed By: lyahdav

Differential Revision: https://phabricator.intern.facebook.com/D37659010

Tasks: T120776572

Tags: marketplace, marketplace_seller_expansion

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	React/Base/RCTUIKit.h
#	React/Base/macOS/RCTUIKit.m
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this issue Aug 10, 2022
Summary:
# Context

RN iOS supports disabling scrolling via `scrollEnabled` prop for multiline text inputs.
https://reactnative.dev/docs/0.68/textinput#scrollenabled-ios

This does [not work](microsoft#925) on MacOS

Since MacOS does not use `UITextView` which inherits from `UIScrollView`, the view manager property was set but not actually passed down to the underlying scroll view.

`RCTMultilineTextInputView` creates a `RCTUIScrollView` which is where we need to disable scrolling.
https://www.internalfb.com/code/archon_react_native_macos/[fde4113acd89fb13ee11636c48b59eac49c21bae]/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m?lines=31

`RCTUIScrollView` inherits from `NSScrollView` which does not have a `scrollEnabled` property, but there is an api we can use to disable scrolling when the property is set.

https://developer.apple.com/documentation/appkit/nsscrollview/1403494-scrollwheel

# Usage

NOTE: Only works with `multiline={true}`

```
<TextInput multiline={true} scrollEnabled={false} ... />
```

# Change

* Only expose the `scrollEnabled` property on `RCTMultilineTextInputView`.
  * `RCTSinglelineTextInputView` does not have scrolling so this property is unused.
* `RCTMultilineTextInputView` delegates the `scrollEnabled` to it's underlying `_scrollView`
* `RCTUIScrollView` defaults initial `scrollEnabled` to `YES`
* `RCTUIScrollView` disables scrolling when the `scrollEnabled` is `NO`

Test Plan:
## Zeratul

```
MDSTextInput
        {...textInputProps}
        {...(IS_MAC
          ? {multiline: true, blurOnSubmit: true, scrollEnabled: false}
          : {})} // workaround for T110399243
```

|before|after|
| https://pxl.cl/27gQp|https://pxl.cl/27gQr|

## RN Tester

|before|after|
|https://pxl.cl/27gRd|https://pxl.cl/27gRh|

Reviewers: lyahdav, ericroz, ackchiu, #seller_expansion

Reviewed By: lyahdav

Differential Revision: https://phabricator.intern.facebook.com/D37659010

Tasks: T120776572

Tags: marketplace, marketplace_seller_expansion

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	React/Base/RCTUIKit.h
#	React/Base/macOS/RCTUIKit.m
@github-actions
Copy link

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 14, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

shwanton pushed a commit to shwanton/react-native-macos that referenced this issue Feb 13, 2023
Summary:
# Context

RN iOS supports disabling scrolling via `scrollEnabled` prop for multiline text inputs.
https://reactnative.dev/docs/0.68/textinput#scrollenabled-ios

This does [not work](microsoft#925) on MacOS

Since MacOS does not use `UITextView` which inherits from `UIScrollView`, the view manager property was set but not actually passed down to the underlying scroll view.

`RCTMultilineTextInputView` creates a `RCTUIScrollView` which is where we need to disable scrolling.
https://www.internalfb.com/code/archon_react_native_macos/[fde4113acd89fb13ee11636c48b59eac49c21bae]/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m?lines=31

`RCTUIScrollView` inherits from `NSScrollView` which does not have a `scrollEnabled` property, but there is an api we can use to disable scrolling when the property is set.

https://developer.apple.com/documentation/appkit/nsscrollview/1403494-scrollwheel

# Usage

NOTE: Only works with `multiline={true}`

```
<TextInput multiline={true} scrollEnabled={false} ... />
```

# Change

* Only expose the `scrollEnabled` property on `RCTMultilineTextInputView`.
  * `RCTSinglelineTextInputView` does not have scrolling so this property is unused.
* `RCTMultilineTextInputView` delegates the `scrollEnabled` to it's underlying `_scrollView`
* `RCTUIScrollView` defaults initial `scrollEnabled` to `YES`
* `RCTUIScrollView` disables scrolling when the `scrollEnabled` is `NO`

Test Plan:
## Zeratul

```
MDSTextInput
        {...textInputProps}
        {...(IS_MAC
          ? {multiline: true, blurOnSubmit: true, scrollEnabled: false}
          : {})} // workaround for T110399243
```

|before|after|
| https://pxl.cl/27gQp|https://pxl.cl/27gQr|

## RN Tester

|before|after|
|https://pxl.cl/27gRd|https://pxl.cl/27gRh|

Reviewers: lyahdav, ericroz, ackchiu, #seller_expansion

Reviewed By: lyahdav

Differential Revision: https://phabricator.intern.facebook.com/D37659010

Tasks: T120776572

Tags: marketplace, marketplace_seller_expansion

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	React/Base/RCTUIKit.h
#	React/Base/macOS/RCTUIKit.m

# Conflicts:
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
shwanton pushed a commit to shwanton/react-native-macos that referenced this issue Mar 10, 2023
Summary:
# Context

RN iOS supports disabling scrolling via `scrollEnabled` prop for multiline text inputs.
https://reactnative.dev/docs/0.68/textinput#scrollenabled-ios

This does [not work](microsoft#925) on MacOS

Since MacOS does not use `UITextView` which inherits from `UIScrollView`, the view manager property was set but not actually passed down to the underlying scroll view.

`RCTMultilineTextInputView` creates a `RCTUIScrollView` which is where we need to disable scrolling.
https://www.internalfb.com/code/archon_react_native_macos/[fde4113acd89fb13ee11636c48b59eac49c21bae]/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m?lines=31

`RCTUIScrollView` inherits from `NSScrollView` which does not have a `scrollEnabled` property, but there is an api we can use to disable scrolling when the property is set.

https://developer.apple.com/documentation/appkit/nsscrollview/1403494-scrollwheel

# Usage

NOTE: Only works with `multiline={true}`

```
<TextInput multiline={true} scrollEnabled={false} ... />
```

# Change

* Only expose the `scrollEnabled` property on `RCTMultilineTextInputView`.
  * `RCTSinglelineTextInputView` does not have scrolling so this property is unused.
* `RCTMultilineTextInputView` delegates the `scrollEnabled` to it's underlying `_scrollView`
* `RCTUIScrollView` defaults initial `scrollEnabled` to `YES`
* `RCTUIScrollView` disables scrolling when the `scrollEnabled` is `NO`

Test Plan:
## Zeratul

```
MDSTextInput
        {...textInputProps}
        {...(IS_MAC
          ? {multiline: true, blurOnSubmit: true, scrollEnabled: false}
          : {})} // workaround for T110399243
```

|before|after|
| https://pxl.cl/27gQp|https://pxl.cl/27gQr|

## RN Tester

|before|after|
|https://pxl.cl/27gRd|https://pxl.cl/27gRh|

Reviewers: lyahdav, ericroz, ackchiu, #seller_expansion

Reviewed By: lyahdav

Differential Revision: https://phabricator.intern.facebook.com/D37659010

Tasks: T120776572

Tags: marketplace, marketplace_seller_expansion

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
#	React/Base/RCTUIKit.h
#	React/Base/macOS/RCTUIKit.m

# Conflicts:
#	Libraries/Text/TextInput/RCTBaseTextInputViewManager.m

# Conflicts:
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h
#	Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m
@bmbmjmdm
Copy link

This is still an issue

@Saadnajmi Saadnajmi reopened this Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: TextInput bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

4 participants