question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: `ion-datetime` time picker incorrectly positioned when rapidly opened or in React/Vue inline ion-popover

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

Hello,

First of all, I want to thank you for this great framework.

I just started an ionic project with the version 6.x (with Vue.js) and I am having a little issue with the time popover when I use the ion-datetime in a popover:

image

This is my code:

<ion-item
    id="datepicker"
    button
    detail="false"
  >
    <ion-icon
      slot="end"
      :icon="calendarOutline"
    />
    <ion-popover
      trigger="datepicker"
      size="cover"
      show-backdrop="false"
      translucent
    >
      <ion-datetime
        first-day-of-week="1"
        hour-cycle="h23"
        size="cover"
        show-default-time-label="false"
        :presentation="presentation"
        :locale="locale"
      />
    </ion-popover>
</ion-item>

Expected Behavior

This should be the expected position:

Steps to Reproduce

  • Click on ion-item
  • Click on time button
  • Position is not correct

I am doing something wrong or is this a bug?

Thanks a lot in advance for your help.

Code Reproduction URL

Ionic Info

My package.json:

  "dependencies": {
    "@capacitor/app": "1.0.7",
    "@capacitor/core": "3.3.3",
    "@capacitor/haptics": "1.1.3",
    "@capacitor/keyboard": "1.2.0",
    "@capacitor/status-bar": "1.0.6",
    "@capacitor/storage": "^1.2.3",
    "@ionic/vue": "^6.0.0",
    "@ionic/vue-router": "^6.0.0",
    "core-js": "^3.6.5",
    "vue": "^3.2.21",
    "vue-router": "^4.0.12"
  }

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
creatxrgithubcommented, Dec 22, 2021

time picker position problem with web browser

import React, { useState, useRef } from 'react'; import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonDatetime } from '@ionic/react'; import ExploreContainer from '../components/ExploreContainer'; import './Tab1.css'; const Tab1: React.FC = () => { const [selectedDate, setSelectedDate] = useState(''); return ( <IonPage> <IonHeader> <IonToolbar> <IonTitle>Tab 1</IonTitle> </IonToolbar> </IonHeader> <IonContent fullscreen> <IonHeader collapse="condense"> <IonToolbar> <IonTitle size="large">Tab 1</IonTitle> </IonToolbar> </IonHeader> <IonDatetime hour-cycle="h23" locale="en-GB" value={selectedDate} onIonChange={e => setSelectedDate(e.detail.value!)}></IonDatetime> </IonContent> </IonPage> ); }; export default Tab1;

time_picker_position_problem

0reactions
ionitron-bot[bot]commented, Sep 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ion-datetime - Ionic Framework
This component displays buttons which show the current date and time values. When the buttons are tapped, the date or time pickers open...
Read more >
Material UI DateTimePicker Rendering In Wrong Spot
It's actually pretty straightforward to have the Picker be open on page load, but the thing you need to be cognizant of when...
Read more >
@ionic/core | Yarn - Package Manager
Ionic is an open source app development toolkit for building modern, fast, top-quality cross-platform native and Progressive Web Apps from a single codebase ......
Read more >
Date picker popup in Ionic 6 | Damir's Corner
Here is a typical markup for a date picker in Ionic 5: ... control to display only the selected date, but the picker...
Read more >
Source - GitHub
**datetime:** The `ion-datetime` component has been revamped to use a new ... Bug Fixes * **menu:** add console error for incorrect usage of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found