Skip to content

fix(ion-alert) when display iOS keyboard, fix alert display position. - #17776

Closed
rdlabo wants to merge 2 commits into
ionic-team:masterfrom
rdlabo:feat/fix_alert_input
Closed

rdlabo wants to merge 2 commits into
ionic-team:masterfrom
rdlabo:feat/fix_alert_input

Conversation

@rdlabo

@rdlabo rdlabo commented Mar 13, 2019 •

Copy link
Copy Markdown
Contributor

Short description of what this resolves:

When use iOS with Cordova or Capacitor, keyboard display resize with ion-app . But if position: fixed, ion-alert will not fix the position. If these setting.

<preference name="KeyboardResizeMode" value="ionic" />
{
  "plugins": {
    "Keyboard": {
      "resize": "ionic",
    }
  }
}

スクリーンショット 2019-03-14 1 43 37

Changes proposed in this pull request:

  • When use iOS with Cordova or Capacitor, ion-alert is position: absolute;

スクリーンショット 2019-03-14 1 43 47

Ionic Version: 4.2

Fixes: #

@ionitron-bot ionitron-bot Bot added the package: core @ionic/core package label Mar 13, 2019
@rdlabo rdlabo changed the title fix: when display iOS keyboard, fix alert display position. fix(ion-alert) when display iOS keyboard, fix alert display position. Mar 13, 2019
@pwespi

pwespi commented Apr 21, 2019

Copy link
Copy Markdown
Contributor

Thank you for this PR. I have been fighting with this issue for some time and can confirm that setting the position to absolute works.

@brandyscarney

Copy link
Copy Markdown
Member

Thank you for the PR! I can only reproduce this with the keyboard plugin installed so I think this needs more investigation into whether it's a core issue or issue with the plugin.

@rdlabo

rdlabo commented Apr 25, 2019 •

Copy link
Copy Markdown
Contributor Author

@brandyscarney Thanks for review. It seems ion-alert height is not ion-app or app-root . ion-alert height is body height in iOS app... This is Safari's specification.

スクリーンショット 2019-04-25 11 26 40

Thanks.

@ippeiukai

ippeiukai commented May 7, 2019 •

Copy link
Copy Markdown

I can only reproduce this with the keyboard plugin installed so I think this needs more investigation into whether it's a core issue or issue with the plugin.

@rdlabo @brandyscarney I think, with keyboard plugin having KeyboardResizeMode value native (default), ion-alert behaves fine because the entire viewpoint gets smaller with keyboard open; the alert moves to the middle of now smaller viewport. When KeyboardResizeMode is body or ionic however, the viewport height stays at full device height and the height of the body or ion-app gets smaller instead; the alert stays at middle of the screen partially underneath the keyboard.

I've stumbled on this bug while experimenting with <preference name="KeyboardResizeMode" value="ionic" /> with <plugin name="cordova-plugin-ionic-keyboard" spec="2.1.3" />.

@ippeiukai

ippeiukai commented May 7, 2019 •

Copy link
Copy Markdown

I ended up with following lines in theme/variables.scss for now; seems to work but not sure how safe it is:

.ios {
  ion-alert {
    // HACK: https://github.com/ionic-team/ionic/pull/17776
    position: absolute !important;
  }
}

@MarcAndreC

MarcAndreC commented Jul 15, 2019 •

Copy link
Copy Markdown

I have this issue too. @ippeiukai your fix is interresting, but doesn't seem to work for me. You are with ios 12?

@EinfachHans

Copy link
Copy Markdown
Contributor

Using @ippeiukai 's workaround works for me. Pls investigate into this

@liamdebeasi

Copy link
Copy Markdown
Contributor

Hi everyone,

Two things I want to mention:

  1. I need to make some changes to this PR, but I do not have access to the branch. I am going to close this PR in favor of fix(alert): correctly position alert when keyboard is open #22425, but I will give @rdlabo co-author credit when merging the PR.
  2. Can everyone try this dev build and let me know if it resolves the issue?

Angular

npm install @ionic/[email protected]

React

npm install @ionic/[email protected] @ionic/[email protected]

Vue

npm install @ionic/[email protected] @ionic/[email protected]

Vanilla JS

npm install @ionic/[email protected]

@liamdebeasi liamdebeasi closed this Nov 3, 2020
@EinfachHans

Copy link
Copy Markdown
Contributor

@liamdebeasi tested - works for me 😊

@liamdebeasi

Copy link
Copy Markdown
Contributor

Hi everyone, this has been merged in #22425 and a fix will be available in an upcoming release of Ionic Framework.

@rdlabo

rdlabo commented Nov 5, 2020

Copy link
Copy Markdown
Contributor Author

Hi. I'm glad to fix this, and I could contribute. Thanks @liamdebeasi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants