Skip to content

bug: [vue] weird behaviour for ion-input focus within ion-modal #30013

Closed

Description

@mohamednagy

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

I have created ion-modal and used the modelController to present the model (just copied the code from here,
the Modal.vue contains multiple ion-input and is triggered as

const modal = await modalController.create({
      component: Modal,
      initialBreakpoint: 0.5
    });

    modal.present();

when setting the initialBreakpoint the focus randomly moves the ion-inputs within the modal, when removing completely the initialBreakpoint it works fine.
see attached video

Screen.Recording.2024-11-12.at.22.13.57.mov

Expected Behavior

  • moving between the ion-inputs should be smooth and focus should be set accordingly.

Steps to Reproduce

  1. create a fresh new installation
  2. copy the implementation from here
  3. set initialBreakpoint to 0.5

Code Reproduction URL

https://ionicframework.com/docs/api/modal#controller-modals

Ionic Info

Ionic:

Ionic CLI : 7.2.0 (/opt/homebrew/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 8.4.0

Capacitor:

Capacitor CLI : 6.1.2
@capacitor/android : not installed
@capacitor/core : 6.1.2
@capacitor/ios : not installed

Utility:

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

System:

NodeJS : v22.9.0 (/opt/homebrew/Cellar/node/22.9.0/bin/node)
npm : 10.8.3
OS : macOS Unknown

Additional Information

No response

Activity

  1. thetaPC commented on Sep 30, 2026

    @thetaPC
    Contributor

    Thanks for the report, and sorry for the delay.

    This is fixed on the latest release: I verified it on 9.0.6. In a modal that opens partway up the screen, scroll assist thinks every input sits under the keyboard, so it waits up to a second before completing focus. In older versions, when that wait ended it moved focus back to the input it was handling, even if you had already tapped a different one. That's why focus seemed to jump randomly. The fix shipped in 8.7.17 with the scroll assist focus fix.

    • Upgrade to 8.7.17 or later, or to 9.x.
    • If you can't upgrade yet, turning off scroll assist avoids it:
    import { IonicVue } from '@ionic/vue';
    
    app.use(IonicVue, { scrollAssist: false });

    One thing to note separately: initialBreakpoint needs breakpoints set too (for example breakpoints: [0, 0.5, 1]). Without it, the modal opens halfway but isn't a real sheet, so there's no drag gesture or handle.

    Closing this since it's resolved in current releases.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions