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

[TextField] Large 'X' shown in IE 11 on production builds #5055

Closed
petermikitsh opened this issue Aug 23, 2016 · 12 comments
Closed

[TextField] Large 'X' shown in IE 11 on production builds #5055

petermikitsh opened this issue Aug 23, 2016 · 12 comments
Labels
design: material This is about Material Design, please involve a visual or UX designer in the process

Comments

@petermikitsh
Copy link
Contributor

Problem description

Single-line TextField components render a large 'X', floated to the right, on IE 11 when the field is focused and the code was built with 'process.env.NODE_ENV': JSON.stringify('production').

In my project:

x

In the documentation site:

x_docs

### Steps to reproduce

In an IE 11 browser, go to http://www.material-ui.com/#/components/text-field and select the 3rd example (the one with text "Default Value").

Versions

  • Material-UI: 0.15.4
  • React: 15.3.1
  • Browser: IE 11, Windows 8.1, in VMWare Fusion on OS X

Note

The 'X' is not present in builds with a JSON.stringify('development') value. It's also not present when setting the multiLine prop. It seems to only present in very specific situations.

I'm not sure if IE 11 is officially supported by material-ui. In the case it's not, I would still find it valuable to have a discussion of how those of us who wish to support it can monkey-patch our own builds.

@petermikitsh
Copy link
Contributor Author

Ah, this probably has something to do with the ::ms-clear pseudo element.

Applies one or more styles to the clear button of a text input control. The clear button is shown only when the text input control has focus and is not empty.

https://msdn.microsoft.com/en-us/library/windows/apps/hh465740.aspx
https://developer.mozilla.org/en-US/docs/Web/CSS/::-ms-clear

And a possible solution:

.someinput::-ms-clear { display: none; }

http://stackoverflow.com/questions/14007655/remove-ie10s-clear-field-x-button-on-certain-inputs

@oliviertassinari oliviertassinari changed the title [Text-Field]: Large 'X' shown in IE 11 on production builds [TextField] Large 'X' shown in IE 11 on production builds Aug 23, 2016
@oliviertassinari
Copy link
Member

We have two related issues #4928 and #4906.

I'm wondering if we should remove it. That clear button seems something users are expecting on this browser. Could we make it less ugly?

@oliviertassinari oliviertassinari added design: material This is about Material Design, please involve a visual or UX designer in the process Cross Browser Support labels Aug 23, 2016
@petermikitsh
Copy link
Contributor Author

Adding the following to my react tree hid the ::ms-clear pseudo element:

<style type='text/css' dangerouslySetInnerHTML={{__html: '::-ms-clear {display: none;}'}} />

I think there is a solid argument for hiding ::ms-clear by default.

  • Given the side effect mentioned in [TextField] On IE, the browser-specific X to clear the text field's contents does not trigger onChange events. #4928, it would seem wise to hide it. If onChange isn't going to fire, then it's doing more harm than good, as it is mis-representing application state to the user. I could imagine situations such as users clicking the 'X' and reasonably assuming the value is empty, and at some point in the future, being confused when the application state does not line up with their mental model of the data. That's the biggest concern-- degraded usability (even if it is due to an issue in react core, beyond the scope of this repository).
  • In terms of the material design specification, there is no concept of ::ms-clear, so it should not be there.
  • From an architectural perspective, it's reasonable to expect material-ui components to look and function with the highest level of parity across all browsers. Minimally, that might be the expectation of the consumers of this module.

Conversely, it would be absolutely possible to style it. I doubt the spec has any opinion in this situation, however.

@avocadowastaken
Copy link
Contributor

Good point @petermikitsh
But there is concept of clearing search value of autocomplete. But it should be for all browsers.

I'm wondering if we should remove it. That clear button seems something users are expecting on this browser. Could we make it less ugly?

@oliviertassinari just inject ::-ms-clear {display: none;} style, like in EnhancedButton, but it will not help with server side rendering

Better solution will come as soon as jss will be implemented

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 26, 2016

Technical speaking

like in EnhancedButton

@umidbekkarimov There is an issue with the EnhancedButton approach. It's breaking encapsulation. We would need to add a specific class name.

but it will not help with server-side rendering

That's basically an issue with the current inline style approach. That's fixed on the next branch.

Visually speaking

@petermikitsh You have some good points.
What do you think about what material design lite is doing?
capture d ecran 2016-08-26 a 17 48 35

@callemall/material-ui Any light here 💡?

@petermikitsh
Copy link
Contributor Author

@oliviertassinari If the X is a little smaller, vertically centered, not #000, (all of which MDL has done) and functions correctly I think it's acceptable being present by default.

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 27, 2016

Here is what we have on the next branch. The color is based on the input color.
I think that we can close this issue as it looks much better:

capture d ecran 2016-08-27 a 19 48 16

I hope that facebook/react#6822 is solved by the time we release next.

@NathanQ
Copy link

NathanQ commented Jul 12, 2017

Sorry, I'm confused about the resolution and unsure what next refers to. React? Issue seen in react 15.5.4 with material-ui 0.17.4. Updated material-ui to 0.18.6 and issue persists. Thanks!

@oliviertassinari
Copy link
Member

next refers to the v1-alpha branch. You can find it on npm under the @next tag.

@christophrus
Copy link

@oliviertassinari So was this completely removed at some point? Really missing this feature.

@oliviertassinari
Copy link
Member

@christophrus It was never added nor removed. It's a browser feature (<input type="search" />).

@JobiLaszlo
Copy link

Try to play with size:

<input type="text" name="email" size="35">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design: material This is about Material Design, please involve a visual or UX designer in the process
Projects
None yet
Development

No branches or pull requests

6 participants