Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

datepicker: case where date and placeholder overlap in IE and FF #10440

Closed
ghost opened this issue Feb 24, 2017 · 3 comments · Fixed by #11538
Closed

datepicker: case where date and placeholder overlap in IE and FF #10440

ghost opened this issue Feb 24, 2017 · 3 comments · Fixed by #11538
Assignees
Labels
browser: FireFox browser: IE This issue is specific to Internet Explorer has: Pull Request A PR has been created to address this issue P2: required Issues that must be fixed. resolution: fixed type: bug ui: CSS ux: integration
Milestone

Comments

@ghost
Copy link

ghost commented Feb 24, 2017

Actual Behavior:

  • What is the issue? *

If $mdDateLocaleProvider.formatDate is configured with special Date-Format,
the initial state of the component is not proper in IE and FF.

  • What is the expected behavior?

Date should not be visible

CodePen (or steps to reproduce the issue): *

  • CodePen Demo which shows your issue:

https://jsbin.com/dimudiw/5/edit?html,js,output

  • Details:

Angular Versions: *

  • Angular Version: 1.5.11
  • Angular Material Version: 1.1.1

Additional Information:

  • Browser Type: * IE, FF
  • Browser Version: * ie 11, ff 51.0.1
  • OS: * Windows
  • Stack Traces: no errors
@busiq
Copy link
Contributor

busiq commented Mar 7, 2017

It seems like it's not really a problem with Datepicker, but with md-input-container instead, take a look here: https://jsbin.com/zilisazade/edit?html,js,output - 2nd input (not nested inside md-input-container) displays date in every browser, and after small research I found this issue #1409.

So it looks like for some reason FF/IE isn't handling this CSS rule properly - https://github.com/angular/material/blob/master/src/components/input/input.scss#L151, but everything works as expected if you divide this rule into 2 chunks (let's say general & webkit specified), just like that:

&:not( .md-input-has-value ) input:not( :focus ) {
  color: transparent;
}

&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-ampm-field,
&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-day-field,
&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-hour-field,
&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-millisecond-field,
&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-minute-field,
&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-month-field,
&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-second-field,
&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-week-field,
&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-year-field,
&:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-text {
  color: transparent;
}

But I'm not sure if that's a good solution.

@EladBezalel EladBezalel self-assigned this Mar 18, 2017
@0xemc
Copy link

0xemc commented Dec 8, 2018

I'm not sure if this is still an issue for others but I found this solution worked in both chrome and firefox

input:not( :focus ) { color: transparent; } input:valid { color: inherit; }

@Splaktar Splaktar changed the title Date in Datepicker is visible in IE and FF datepicker: Date is visible in IE and FF Dec 9, 2018
@Splaktar Splaktar added type: bug browser: IE This issue is specific to Internet Explorer browser: FireFox ux: integration labels Dec 9, 2018
@Splaktar Splaktar changed the title datepicker: Date is visible in IE and FF datepicker: case where date and placeholder overlap in IE and FF Dec 9, 2018
@Splaktar Splaktar self-assigned this Dec 9, 2018
@Splaktar Splaktar added this to the 1.1.12 milestone Dec 9, 2018
@Splaktar Splaktar added ui: CSS P3: important Important issues that really should be fixed when possible. has: Pull Request A PR has been created to address this issue P2: required Issues that must be fixed. and removed P3: important Important issues that really should be fixed when possible. labels Dec 9, 2018
@Splaktar Splaktar modified the milestones: 1.1.12, 1.1.11 Dec 9, 2018
Splaktar added a commit that referenced this issue Dec 9, 2018
css to hide the value doesn't work on Firefox and IE11
this is due to combining webkit pseudo selectors with the general rule

Fixes #10440
@Splaktar
Copy link
Member

Splaktar commented Dec 9, 2018

PR #11538 opened to fix this.

jelbourn pushed a commit that referenced this issue Dec 20, 2018
…11538)

css to hide the value doesn't work on Firefox and IE11
this is due to combining webkit pseudo selectors with the general rule

Fixes #10440
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
browser: FireFox browser: IE This issue is specific to Internet Explorer has: Pull Request A PR has been created to address this issue P2: required Issues that must be fixed. resolution: fixed type: bug ui: CSS ux: integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants