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

bug: floating label is not centered in input on ios mode #20153

Closed
gugahoi opened this issue Jan 7, 2020 · 2 comments
Closed

bug: floating label is not centered in input on ios mode #20153

gugahoi opened this issue Jan 7, 2020 · 2 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@gugahoi
Copy link

gugahoi commented Jan 7, 2020

Bug Report

Ionic version:

[x] react 4.11.0

Current behavior:
IonLabel is positioned incorrectly in iOS only. It seems IonLabel is far too low when used in an input box for iOS user agents. It is positioned correctly for Web and Android user agents however - refer to screenshots below.

Expected behavior:
iOS labels should be centered just like in the Web or Android version

Steps to reproduce:
Using the dark theme described in the documentation and trying to use floating labels. No other styling changes required.

Related code:

// Input.tsx
import React from 'react'
import { TextFieldTypes } from '@ionic/core'
import { IonInput, IonItem, IonLabel } from '@ionic/react'

type InputProps = {
    placeholder: string
    type?: TextFieldTypes
}

const Input = ({ placeholder, type = 'text' }: InputProps) => (
    <IonItem className='ion-margin-vertical'>
        <IonLabel position='floating'>{placeholder}</IonLabel>
        <IonInput type={type} />
    </IonItem>
)

export default Input

Using it like below

<form>
    <Input type='email' placeholder='Email Address' />
    <Input type='password' placeholder='Password' />
    <IonButton
        expand='block'
        onClick={submit}
        type='submit'
    >
        Sign In
    </IonButton>
</form>

Other information:

Screenshot with iOS user agent

It is quite easy to see how the Password label is misplaced (specially when comparing to the android screenshot), however when selecting the input box, the label floats correctly.

Screen Shot 2020-01-07 at 3 51 40 pm

Screenshot with Android user agent

Screen Shot 2020-01-07 at 3 51 27 pm

Ionic info:

> ionic info

Ionic:

   Ionic CLI       : 5.4.13 (/usr/local/lib/node_modules/ionic)
   Ionic Framework : @ionic/react 4.11.7

Capacitor:

   Capacitor CLI   : 1.4.0
   @capacitor/core : 1.4.0

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v13.2.0 (/usr/local/Cellar/node/13.2.0/bin/node)
   npm    : 6.13.1
   OS     : macOS Catalina
@ionitron-bot ionitron-bot bot added the triage label Jan 7, 2020
@liamdebeasi liamdebeasi changed the title bug: IonLabel not centered correctly inside input fields on iOS devices bug: floating label is not centered in input on ios mode May 3, 2022
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels May 3, 2022
@ionitron-bot ionitron-bot bot removed the triage label May 3, 2022
@liamdebeasi liamdebeasi added type: bug a confirmed bug report and removed type: bug a confirmed bug report labels Nov 2, 2022
liamdebeasi added a commit that referenced this issue Nov 15, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the report. In Ionic 7 we will be introducing a new syntax for using form components such as ion-input. You can find a summary of the changes here: #25661

The reported issue is fixed with this new syntax. Work to update ion-input to use this new syntax has been completed, so I am going mark this issue as resolved. We plan to have a public beta period for Ionic 7 in the future. You can visit the Ionic Blog, Ionic Twitter, or our GitHub Releases Page to be notified when the Ionic 7 beta is released. Let me know if you have any questions. Thanks!

@ionitron-bot
Copy link

ionitron-bot bot commented Dec 15, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants