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

15 pixel different in width between Firefox and Chrome #135

Open
amdrew opened this issue Mar 12, 2018 · 6 comments
Open

15 pixel different in width between Firefox and Chrome #135

amdrew opened this issue Mar 12, 2018 · 6 comments

Comments

@amdrew
Copy link

amdrew commented Mar 12, 2018

I did search so I apologize if it's already been discussed.

There seems to be a 15px difference in width between Firefox and Chrome (probably Safari as well).

I.e the examples page (http://jedwatson.github.io/react-input-autosize/):

Chrome:
Width of bottom input is 78 pixels

screen shot 2018-03-12 at 7 22 55 pm

Firefox:
Width is 93 pixels

screen shot 2018-03-12 at 7 23 11 pm

I'm seeing the same 15 px difference in my project.

@dliu120
Copy link

dliu120 commented Apr 5, 2018

+1

This PR fixes the issue. I am currently overriding the sizer style(s) with css:

div[style] {
    overflow: hidden !important;
}

@danielrob
Copy link

danielrob commented Jun 26, 2018

@dliu120 this raises the input above the line for me in Firefox 60.0.2 on OSX (sandbox). My current very sad bit of browser detection workaround is:

const WrapHackAutosizeInput = styled.span`
  div[style] {
    margin-right: ${() => window.navigator.userAgent.includes('Firefox') ? '-17px' : '-2px'};
  }
`

@iJoyCode
Copy link

Same problem, fix pls

@wtesler
Copy link

wtesler commented Oct 16, 2018

Same

@keul
Copy link

keul commented Oct 24, 2019

The most annoying behavior I have is when the field is empty, where I have an input as 17 pixel width.

On a react-select based project I have (that internally use this library) emtpy selects (on the left) fills more vertical space because the input goes on a second line.

Schermata 2019-10-24 alle 13 39 51

@ozluy
Copy link

ozluy commented Mar 6, 2020

I just created a new NPM module please check it out:

  • 252 byte size only 10% of react-input-autosize (2.3KB)

https://github.com/ozluy/calculate-text-width
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants