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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE Edge - TextField placeholder doesn't disappear when field is not focused #15183

Closed
2 tasks done
rodrigoea opened this issue Apr 3, 2019 · 12 comments 路 Fixed by #15267
Closed
2 tasks done

IE Edge - TextField placeholder doesn't disappear when field is not focused #15183

rodrigoea opened this issue Apr 3, 2019 · 12 comments 路 Fixed by #15267
Labels
bug 馃悰 Something doesn't work component: text field This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@rodrigoea
Copy link
Contributor

rodrigoea commented Apr 3, 2019

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 馃

Placeholder should disappear when the field is not focused (IE Edge).

Current Behavior 馃槸

Placeholder and Label are being displayed over top of each other.

Steps to Reproduce 馃暪

As this is easy to reproduce, I've recorded a gif so we can easily see below.

bug-ie-edge

Access the link listed below from a IE Edge browser.

Link:

  1. https://material-ui.com/demos/text-fields/

Context 馃敠

I found this bug trying to access an application that uses 2FA. When It asked to paste the received code, I've clicked outside the window and realized that bug.

Your Environment 馃寧

Tech Version
Material-UI v3.8.2
React 16.8.0
Browser IE Edge
TypeScript -
etc. -
@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 6, 2019

@joshwooding
Copy link
Member

placeholder_edge

Tried this on edge, looked fine to me?

@joshwooding
Copy link
Member

joshwooding commented Apr 6, 2019

placeholder_ie
Looks like it's broken on IE11 though (unlike edge this was tested on next)

@oliviertassinari
Copy link
Member

I have tried with Edge 18. It's working fine.

@oliviertassinari
Copy link
Member

@rodrigolabs Could you provide us more information on the reproduction. IE 11 issue seems to be "normal" the browser hides the placeholder once the input is focused. Edge is good on our side.

@oliviertassinari oliviertassinari added the component: text field This is the name of the generic UI component, not the React module! label Apr 6, 2019
@oliviertassinari
Copy link
Member

I'm closing for now.

@rodrigoea
Copy link
Contributor Author

@rodrigolabs Could you provide us more information on the reproduction. IE 11 issue seems to be "normal" the browser hides the placeholder once the input is focused. Edge is good on our side.

Thanks for the replies :)

@oliviertassinari

Well, I've just recorded a new reproduction. I don't know if you guys were testing as expected, but this is what I did:

  • Focus the text field
  • Click in the Address Bar
  • Label and Placeholder will overlap

See the new preview, tested with Edge:

ieEdge

image

@oliviertassinari
Copy link
Member

@rodrigolabs This is the only workaround I can find:

--- a/packages/material-ui/src/InputBase/InputBase.js
+++ b/packages/material-ui/src/InputBase/InputBase.js
@@ -104,7 +104,10 @@ export const styles = theme => {
         '&::-webkit-input-placeholder': placeholderHidden,
         '&::-moz-placeholder': placeholderHidden, // Firefox 19+
         '&:-ms-input-placeholder': placeholderHidden, // IE 11
-        '&::-ms-input-placeholder': placeholderHidden, // Edge
+        '&::-ms-input-placeholder': {
+          ...placeholderHidden,
+          color: 'transparent',
+        }, // Edge
         '&:focus::-webkit-input-placeholder': placeholderVisible,
         '&:focus::-moz-placeholder': placeholderVisible, // Firefox 19+
         '&:focus:-ms-input-placeholder': placeholderVisible, // IE 11

But we lose the opacity animation. What do you prefer?

@rodrigoea
Copy link
Contributor Author

@oliviertassinari it seems that if we put a !important in placeholderHidden, it works fine:

const placeholderHidden = {
  opacity: 0 !important,
};

I think we won't lose the opacity animation with that. What's your opinion?

@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 8, 2019

@rodrigolabs wow, that's awesome! I confirm the resolution. Do you want to submit a pull request? :)

@oliviertassinari oliviertassinari added bug 馃悰 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process. and removed waiting for user information labels Apr 8, 2019
@rodrigoea
Copy link
Contributor Author

@oliviertassinari Sure, I'll be happy to do that! :)
I'll open the PR and mention you there.

@robmarshall
Copy link

This seems to have regressed when using Preact on Chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 馃悰 Something doesn't work component: text field This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants