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

Float label not moving over input in Firefox #5657

Closed
fperezgaliana opened this issue Apr 30, 2018 · 10 comments
Closed

Float label not moving over input in Firefox #5657

fperezgaliana opened this issue Apr 30, 2018 · 10 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@fperezgaliana
Copy link

I'm submitting a ... (check one with "x")

[ X ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
After updating to PrimeNG 5.2.5, all the float label inputs in my app stopped moving the label above the input when the user clicks on them. This is how they look now:

imagen

Also, I realized that the example on the PrimeNG website does the same:

imagen

I've tried this on several computers: Firefox 51 for MacOS, Firefox 57 on Ubuntu 17.10 and Firefox 59 on Ubuntu 17.10 and 18.04. On Google Chrome, it seems to work fine.

Expected behavior
The float label show position itself above the inputs when the user clicked on them. This is an screenshot of the app running on Chrome:
imagen

Please tell us about your environment:
I use Ubuntu 18.04 x64. The web server is NG Live Development Server 1.7.4 and Node 9.9.0.

  • Angular version: 5.X
    5.2.10

  • PrimeNG version: 5.X
    5.2.5

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    Firefox 59 on Ubuntu 18.04 x64
    Firefox 59 on Ubuntu 17.10 x64
    Firefox 51 on MacOSX Sierra
    Firefox 57 on Ubuntu 17.10

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    all

  • Node (for AoT issues): node --version =
    v9.9.0

@iArnoldo
Copy link

I had the same problem in 5.2.3 and prior. I had to write a directive which toggled the class 'ui-state-filled'.

@axinedy
Copy link

axinedy commented May 3, 2018

I have this too label text overlaps the entered text with Firefox in text input field (all ok with Chrome).
But if I add floating label to chips input field - label overlaps input text in both browsers - Firefox and Chrome:
https://imgur.com/a/JTASlh7

@stefalda
Copy link

stefalda commented May 4, 2018

@iArnoldo can you show the code of your directive?
thanks

@jnkb
Copy link

jnkb commented May 4, 2018

Did you forgot to import InputTextModule in the module? (this was the reason for this on my side)

@stefalda
Copy link

stefalda commented May 4, 2018

Nope, as a matter of fact, it works flawlessly with Chrome.
It seems a problem with the CSS... it doesn't detect that the Input is focused or compiled...

@marcoberri
Copy link

Hi have the same problem!

Angular version: 5.2.10
PrimeNG version: 5.2.5
FireFox version: 59.03 64bit

@iArnoldo
Copy link

iArnoldo commented May 4, 2018

@stefalda

import { Directive, OnInit, OnDestroy, ElementRef } from '@angular/core';
import { FormControlName } from '@angular/forms';
import { Subscription } from 'rxjs/Subscription';

@Directive({
  selector: '[loginFormControl]'
})
export class LoginFormDirective {

  valueOfTheForm: Subscription;

  constructor(
    private el: ElementRef,
    private formControlName: FormControlName // Inject FormControlName
  ) {

  }

  ngOnInit() {
    this.valueOfTheForm = this.formControlName.valueChanges.subscribe(value => {

      const inputFields = this.el.nativeElement;
      inputFields.classList.toggle('ui-state-filled', value);

    });
  }
  ngOnDestroy() {
    this.valueOfTheForm.unsubscribe(); 
  }

}


There you go. I hope it helps.

@jnkb
Copy link

jnkb commented May 8, 2018

i have added to my css:

.ui-float-label>input:focus~label,
.ui-float-label>input.ui-state-filled~label,
.ui-float-label>.ui-inputwrapper-focus~label,
.ui-float-label>.ui-inputwrapper-filled~label {
    top: -.75em;
    font-size: 12px;
}

in the original css the additional selector

.ui-float-label>input:-webkit-autofill~label

breaks the whole block in firefox

@stefalda
Copy link

stefalda commented May 8, 2018

@jnkb I confirm your patch works in Firefox...

it seems to work ok even in the latest Chrome.

Will this be merged in the code?

Thanks

@stefalda
Copy link

stefalda commented May 8, 2018

@iArnoldo Thanks for posting the code.

@cagataycivici cagataycivici self-assigned this May 31, 2018
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label May 31, 2018
@cagataycivici cagataycivici changed the title Float label not moving over input after updating to 5.2.5 in Firefox Float label not moving over input in Firefox May 31, 2018
@cagataycivici cagataycivici added this to the 6.0.0-alpha.2 milestone May 31, 2018
ldauvilaire added a commit to ldauvilaire/primeng that referenced this issue Jun 16, 2018
* Fixed primefaces#5577

* Fixed primefaces#5168

* Fixed  primefaces#5270

* Fixed primefaces#5184

* Fixed primefaces#5200

* Fixed primefaces#5274

* Fixed invalid closing tags in table docs example

* Fixed primefaces#5250

* Fixed primefaces#5121

* Refactor on ScrollPanel demo

Fixed primefaces#5532

* Fixed primefaces#5124

* Fixed primefaces#5196

* Fixed primefaces#5207

* Fixed primefaces#5174

* Fixed primefaces#5282

* Fixed primefaces#5211

* Docs for multiselect change detection

* Fixed primefaces#5218

* Fixed primefaces#5169

* Fixed primefaces#5167

* Fixed primefaces#5144

* Fixed #primefaces#5158

* Fixed primefaces#5148

* Fixed primefaces#5123

* set class ui-state-disabled when component is disabled

* Fixed primefaces#5131

* [Fix primefaces#5598] Disable component-class-suffix rule.

As Component suffix is never used in component classes in the whole project,
we expect this rule disabled in tslint.

* [Fix primefaces#5598] ignore no-inferrable-types rule on class properties.

As all class properties are typed, even the obvious ones
(e.g: inline: boolean = false;)
And those can be considered as documentation for an open-source project,
Then we should ignore this rule on class components.

* fix trailing comma

* Fixed primefaces#5159

* Replaced plunkr with stackblitz

* Fixed primefaces#5102

* Fixed primefaces#5193

* Fixed primefaces#5469

* Fixed primefaces#5632

* Refactor primefaces#5549

* Fixed primefaces#5633

* Version update

* Fix demo

* Fixed primefaces#5634

* Fixed primefaces#5503

* Fixed demo source display

* Add doc for hideDelay

* Use setTimeout within runOutsideAngular

* Fixed primefaces#5499

* Fixed primefaces#5637

* Set version

* AOT fixes

* New iteration

* Version at footer

* Fixed primefaces#5656

* Demo fix

* Fix table component only applying the last filter before timeout (primefaces#5660)

* Fixed primefaces#5664

* Update text

* Update text

* Delete ng-conf2018 section

* Fixed primefaces#5672

* Fixed primefaces#5673

* Add ui-multiselect-open class to ui-multiselect and typo fix for multiselect documentation

* Fixed 5687

* Fixed primefaces#5693

* Fixed primefaces#5697

* Fixed primefaces#5699

* Fixed primefaces#5702

* Add style classes for icons

* Set version

* Fix AOT issue

* New version

* Fixed quote

* Add Harmony

* Doc update

* Fixed primefaces#5731

* Fixed primefaces#5705

* Names for icons

* Fixed primefaces#4409

* Add designer to homepage

* Firefox button fix

* Fixed primefaces#5664

* Fixed primefaces#5729

* Fixed primefaces#5744

* Set version

* Change the position of }

* Fixed #primefaces#5758

* Polyfill update

* Demo cosmetics to add margins since Angular 6 has preserveWhiteSpace as false by default now

* Ignore angular.json

* Set version

* New dev iteration

* Version

* Change logo

* Change favicon

* Change logo

* Fix URL

* Syntax Error

Interface syntax Error double curly braces {{ }}

* Fixed primefaces#5772

* Initiated new TreeTable

* Placeholders for new TreeTable demos

* Color for toggler

* update progress spinner link

* Pagination and Sections for new TreeTable

* Single and Multi sort for new TreeTable

* Update state on node toggle

* Lazy loading TreeTable

* Refactor sort demo

* Loading icon for Lazy TreeTable

* Lazy children loading demo for new TreeTable

* Column grouping for new TreeTable

* Demo code refactor

* Added colgroup template support

* Responsive demo for new TreeTable

* Initiated scrollable for new TreeTable

* Remove comma

* Demo update for colgroup

* More data for TreeTable demo

* Implemented scrolling for new TreeTable

* Remove typo

* Row and Cell based styling for new TreeTable

* Cosmetics

* Implemented resizable columns for new TreeTable

* Fixed primefaces#5804

* Column reordering for new TreeTable

* Remove "new" badges from the older components

* Cosmetics

* Toggleable columns for new TreeTable

* Selection for new TreeTable

* Source code for selection demo

* Name refactor for TreeTable directives

* ContextMenu integration for new TreeTable

* Implemented checkbox selection for the new TreeTable

* Doc update

* Header checkbox support for new TreeTable to toggle all nodes

* Incell editing for new TreeTable

* Started documentation for new TreeTable

* Documentation fixes

* Documentation update for TreeTable

* Documentation for new TreeTable

* Fixed typos

* Fixed primefaces#5446

* Fixed primefaces#5706

* Remove unused section

* Fixed primefaces#5657

* Fixed primefaces#5618

* Cosmetics for Demo

* Set version

* New iteration

* Initiated PrimeIcons for PrimeNG

* Fixed primefaces#3746

* Use PrimeIcons for the remaining components

* Updated demos to use PrimeIcons

* Cosmetic changes due to new PrimeIcons

* Bigger loader icon

* Doc update

* Issue template update

* Fixed primefaces#5853

* Fixed primefaces#5854

* Fixed primefaces#5829

* Chart doc typos. Fix for set sizing in responsive mode.

* Made width also work in responsive mode, then forgot to update docs.

* Fixes the turbo table scrollbar overlapping the paginator.

* accessibility(accordion): correctly using of role attribute

* ChartJS generateLegend need to return the HTML string.

* Documentation for PrimeIcons

* Demo fixes

* Fixed primefaces#5751

* Fixed icons

* Convert NodeList to array

* Fixed primefaces#5847

* Add ecuador

* Update version at footer

* Doc update

* Set version

* New dev version

* Fixed primefaces#5867

* Fixed primefaces#5211

* Readme update

* Showcase split button fix

* Fixed primefaces#5882

* PrimeIcons fix

* Remove deprecated components from demo menu

* PrimeIcons fix

* Remove unused property

* Fixed primefaces#5387

* Fixed primefaces#5368

* Fixed primefaces#5359

* Fixed primefaces#5329

* Fixed icon name

* Fixed primefaces#5891

* Fixed primefaces#4124 - Maximizable Dialog

* Block scroll

* Update to new PrimeIcons

* Cosmetics

* Fixed primefaces#5893

* Doc update

* Fixed primefaces#5348

* Refactor

* Animation for dialog maximize

* Demo update

* Version at footer

* Remove deprecated lazy prop from tabview

* Set version

* New version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

7 participants