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: searchbar placeholder not aligned properly on iOS #20456

Closed
liamdebeasi opened this issue Feb 12, 2020 · 1 comment
Closed

bug: searchbar placeholder not aligned properly on iOS #20456

liamdebeasi opened this issue Feb 12, 2020 · 1 comment
Labels
package: core @ionic/core package type: bug a confirmed bug report
Milestone

Comments

@liamdebeasi
Copy link
Contributor

liamdebeasi commented Feb 12, 2020

Bug Report

Ionic version:

[x] 5.x

Current behavior:

When supplying an HTML string as placeholder for a searchbar on iOS mode, the placeholder is displayed as plaintext but not aligned properly. This is because we create a temporary span and actually render the HTML content + then get the width of the element. The actual placeholder is displayed as plaintext and therefore may have a different width.

Since the native placeholder does not accept HTML, we should not be parsing into the temporary span as HTML.

Expected behavior:

I would expect the placeholder to be aligned properly.

Steps to reproduce:

  1. Create ion-searchbar in iOS mode
  2. Supply a placeholder of <ion-searchbar>Test</ion-searchbar>.
  3. Focus and then blur searchbar.
  4. Notice placeholder label is not centered.

https://github.com/ionic-team/ionic/blob/master/core/src/components/searchbar/searchbar.tsx#L338

@ionitron-bot ionitron-bot bot added the triage label Feb 12, 2020
@liamdebeasi liamdebeasi added this to the 5.0.1 milestone Feb 12, 2020
@liamdebeasi liamdebeasi added the type: bug a confirmed bug report label Feb 12, 2020
@ionitron-bot ionitron-bot bot removed the triage label Feb 12, 2020
@liamdebeasi liamdebeasi added package: core @ionic/core package triage labels Feb 12, 2020
@ionitron-bot ionitron-bot bot removed the triage label Feb 12, 2020
@ionitron-bot
Copy link

ionitron-bot bot commented Mar 13, 2020

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 Mar 13, 2020
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

1 participant