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

[Android] Scroll appears in TextInput with custom fonts and multiline=true #18132

Closed
mxck opened this issue Feb 28, 2018 · 35 comments
Closed

[Android] Scroll appears in TextInput with custom fonts and multiline=true #18132

mxck opened this issue Feb 28, 2018 · 35 comments
Labels
Bug Component: TextInput Related to the TextInput component. Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@mxck
Copy link

mxck commented Feb 28, 2018

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
  OS: macOS High Sierra 10.13.3
  Node: 9.5.0
  Yarn: 1.3.2
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  react: 16.2.0 => 16.2.0
  react-native: 0.53.3 => 0.53.3

Steps to Reproduce

  1. Add custom font to project (added to rnpm and react-native link).
  2. Use this font in TextInput with multiline={true}

Expected Behavior

Get multiline input without scroll

Actual Behavior

Multiline input with scroll.
screnshot
(1. Stardart font, 2-4. Custom fonts)

Reproducible Demo

import React from "react";
import { View, TextInput } from "react-native";

const LOREM =
  "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco";

export default function App() {
  return (
    <View>
      <TextInput value={LOREM} multiline />
      <TextInput
        style={{ fontFamily: "OpenSans-Bold" }}
        value={LOREM}
        multiline
      />
      <TextInput
        style={{ fontFamily: "Nunito-Regular" }}
        value={LOREM}
        multiline
      />
      <TextInput
        style={{ fontFamily: "DK Sugary Pancake" }}
        value={LOREM}
        multiline
      />
    </View>
  );
}

I also tried to set autoGrow={true} but resultis the same

Full code with fonts (fonts from google fonts, so they are free).
https://github.com/mxck/react-native-TextInput-multiline-bug

@mxck mxck changed the title [Android] Scroll indicator appears in TextInput with custom fonts and multiline=true [Android] Scroll appears in TextInput with custom fonts and multiline=true Feb 28, 2018
@hramos
Copy link
Contributor

hramos commented Feb 28, 2018

@facebook-github-bot label Android

@facebook-github-bot
Copy link
Contributor

Something went wrong executing that command, @hramos could you take a look?

@hramos hramos added the Android label Mar 8, 2018
@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Component: TextInput Related to the TextInput component. Android labels Mar 16, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@react-native-bot react-native-bot added the Platform: macOS Building on macOS. label Mar 20, 2018
@hramos hramos removed the Platform: macOS Building on macOS. label Mar 29, 2018
@stale
Copy link

stale bot commented Jun 27, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 27, 2018
@rikur
Copy link

rikur commented Jul 13, 2018

+1

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 13, 2018
@bsbechtel
Copy link

bsbechtel commented Sep 23, 2018

I had this same issue. Eventually, I figured out a work around by setting height larger or reducing font-size on the TextInput component.

Edit: use min-height if you want your TextInput to expand automatically

@rikur
Copy link

rikur commented Nov 24, 2018

What makes it even worse is that scrollEnabled={false} doesn't remove the scroll either.

@mloureiro
Copy link

@rikur scrollEnabled is iOS setting only.

@vini-btc
Copy link

vini-btc commented Dec 10, 2018

Also had the same issue. It looks like there's something wrong with the TextInput height calculation when mounting it with content and a custom font. The workaround in my case was to first render it empty and then set its content.

@xhirazi
Copy link

xhirazi commented Apr 23, 2019

+1

@stale
Copy link

stale bot commented May 13, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label May 13, 2020
@rikur
Copy link

rikur commented May 14, 2020

Still a bug

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label May 14, 2020
@stale
Copy link

stale bot commented Aug 16, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 16, 2020
@rikur
Copy link

rikur commented Aug 18, 2020

AFAIK, still a bug in latest RN.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 18, 2020
@vyashole
Copy link

vyashole commented Aug 19, 2020 via email

@safaiyeh
Copy link
Contributor

safaiyeh commented Aug 19, 2020

@fabriziobertoglio1987 did you have a PR that addressed this?

@stale
Copy link

stale bot commented Dec 25, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 25, 2020
@fabOnReact
Copy link
Contributor

thanks @safaiyeh , I think you refer to my pr #29025

fixes a bug causing ScrollView to not detect scroll gesture when including a TextInput with textAlign center.

while here I don't see a ScrollView, the issue should be investigated in the TextInput.js functionalities and ReactAndroid TextInput API

Hopefully I'll have time in this days to take a look.. Thanks a lot!

@KyawSoeHein
Copy link

I faced the similar problem but my problem was I accentially set the height of textinput. So, it becomes scrollable with extra spaces, the problem was solved once I removed the height.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 22, 2021
@jacdx
Copy link

jacdx commented Jun 19, 2021

Still broken on React Native 0.64. This is a pretty big issue. No solution worked for me other than removing the custom font.

@MarwaKhaledMohamed
Copy link

I'm still facing the same problem( I'm using a custom font ). the issue happening when the text input has font size style when I removed the font size the scroll disappeared so I think the problem is related to the text input height which affected by the font size. I hope you can fix this issue soon.

@sajith198
Copy link

sajith198 commented Sep 21, 2021

I guess its due to the default Vertical padding present in the component . I just manually added a paddingVertical and it solved my issue !!. (try a lower value like 1 or 2 )

@stale
Copy link

stale bot commented Jan 9, 2022

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 9, 2022
@MuhammadRafeh
Copy link

I am facing same exact issue

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 2, 2023
@Reykjavik151
Copy link

still the same - RN hasn't an opportunity to disable visibility for TextInput multiline scroll

@TommysG
Copy link

TommysG commented Aug 12, 2023

Any solution for this? This also creates a problem. If you have several textinput with custom font inside a scrollview, you can't scroll on the screen by touching on them (due to the internal TextInput scroll). Any workaround? The only thing that worked was removing custom font from TextInput.

@galaxykhh
Copy link

still a bug on RN 0.72.6

@ng-ha
Copy link

ng-ha commented Dec 13, 2023

style={{includeFontPadding: false}} works for me

Copy link

This issue is stale because it has been open 180 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 There has been a lack of activity on this issue and it may be closed soon. label Jun 11, 2024
Copy link

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Component: TextInput Related to the TextInput component. Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests