Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228535 articles
Browse latest View live

Ionic 5 ion-split-pane when selecting a side panel link the view renders the component and after that all the links do not work

$
0
0

Found the solution it was the urls in the menuItems array in the side-menu.component.ts. I needed to fix the relative path of each url to call out the right route path:

  menuItems = [
    { title: 'Create', url: '/javier-staging/main/create-page', icon: 'add' },
    { title: 'Procedure', url: '/javier-staging/main/procedures', icon: 'create-outline' },
    { title: 'ClassroomAR', url: 'classroomAR', icon: 'school-outline' },
    { title: 'Contacts', url: 'contacts', icon: 'person-add-outline' }
  ];

What dummy I am :crazy_face:


Optional chaining and Nullish coalescing don't work with Typescript

$
0
0

It was 3.9.6 and i did update to 4.1.6 still same

Optional chaining and Nullish coalescing don't work with Typescript

$
0
0

Add samsung 12.0 to your .browserslistrc file and restart the build (i.e. rerun whatever command you used to start the local server).

e.g.:

//.browserslistrc
> 1%
last 2 versions
not dead
not ie 11
samsung 12.0   <- add this

How can I use Infinite Scroll with Typescript?

$
0
0

It seems like for some reason Vue’s events either have some extra properties or are missing some from standard Event interfaces…I just cast them to any or if passed to a function, set the corresponding parameter to any when I encounter that problem, since I know that those properties do exist, and probably won’t cause problems.

This isn’t an ideal solution, unfortunately, but it’s quick and easy and shouldn’t really cause any problems, as far as I can see.

Relevant code:

//               👇👇👇👇 👈 set to any to get rid of errors  
const loadData = (ev: any) => {
  setTimeout(() => {
    pushData();
    console.log("Loaded data");
    ev.target.complete();
    // App logic to determine if all data is loaded
    // and disable the infinite scroll
    if (items.value.length == 1000) {
      ev.target.disabled = true;
    }
  }, 500);
};

Sample repo with full code

Not sure I got your question correctly, if not, it would be helpful if could post a repo/sandbox link with your code

Cheers

Optional chaining and Nullish coalescing don't work with Typescript

$
0
0

Can you create a GitHub repo with an app where this issue happens?

How can I use Infinite Scroll with Typescript?

$
0
0

The main issue here is that the complete method is a method on ion-infinite-scroll, which is of type HTMLIonInfiniteScrollElement, but event.target is of type EventTarget. This is normally fine, but when you add custom methods and properties this can cause issues.

We have an open issue that proposes new interfaces to improve the target typing: feat: extend CustomEvent

We plan on having this in Ionic Framework v6.

You can typecast event.target as type HTMLIonInfiniteScrollElement as a temporary workaround. In the future, you will be able to set the event type as InfiniteScrollCustomEvent which will have the target typings built in.

Optional chaining and Nullish coalescing don't work with Typescript

$
0
0

This fixed the issue. Thanks mate. Cheers :partying_face:

Though it’s strange that is working on my regular vue 3 project which has just:

1%
last 2 versions
not dead

Timer across multiple pages

$
0
0

Thank you very much. It works almost perfectly… except for one small issue.

On the page where I use the timer, I have a function that gets the questions for the user:
question.page.ts

...
if (this.nextquestionnum !== undefined) {
          this.router.navigate(['../',this.nextquestionnum], {relativeTo: this.activatedRoute});
    }
...

where this.nextquestionnum is a page in an array of pages. Unfortunately, every time a new page is obtained, the timer restarts from 10, rather than continuing from whatever value it was on before switching. I tried to solve this using an if-statement to run the timer service only once, but it did not fix the problem. I would appreciate it if you could help with this as well.

Thanks.


Timer across multiple pages

$
0
0

The design is intended so that the only way the timer restarts is if you call startCountdown. I guess there could be a bug where that isn’t the case, but can you please double-check that you aren’t calling startCountdown accidentally (via a lifecycle event hook or something)?

How do you inject dynamically constructed HTML that requires events to be subscribed to?

$
0
0

I have a scenario that i do not know how to implement in Ionic Vue. My app needs to mark-up the text entered by the user with visual tags, which are clickable, in my mobile Ionic app. E.g.,

How do I inject the HTML so that it is compiled by Ionic Vue and handlers assigned when someone taps the colored tags?

How do you inject dynamically constructed HTML that requires events to be subscribed to?

$
0
0

Disclaimer: I’ve zero experience with Vue, so this is going to be a generic response that you’ll likely want to just ignore anyway, because it’s going to try to convince you not to go down this road at all. Additionally, I apologize for the fact that the links in this post go to Angular topics, because that’s the framework I work in.

HTML is a relatively difficult language to parse and treat in a structured fashion, largely because so many things that were never intended in the first place have been shoehorned into it. Because it can also contain content that is “executable code” for most purposes, it’s got significant security concerns that require vigilant mitigation, especially when dealing with user-generated content.

I would urge you to pick something other than HTML as your domain transfer language here, and render that into HTML as part of your app. Some subset of JSON will probably be easiest to work with, but I’ve used this basic strategy with Markdown to implement message board functionality in an Ionic app.

One massive upside of going that route is that your current problem gets completely designed away, because you don’t have to worry about complex sanitization rules at all, and can just lay your content out as a heterogeneous list. Your colored box things can respond to events, have tooltips, twirl around in circles, or whatever you desire.

How do you inject dynamically constructed HTML that requires events to be subscribed to?

$
0
0

So I could create a custom component for rendering a word, and another for tag, and inject them all inline as regular components. The texts are not long, but this would produce a sequence of about 100 components inline. But I see what you are saying.

How do you inject dynamically constructed HTML that requires events to be subscribed to?

$
0
0

Here’s where my Vue ignorance is going to be felt, because I can’t say whether that’s necessarily true or not. With Angular, there is a notion of a “template fragment” that is substantially lighter in weight than a full component, and there isn’t a need to actually make an actual “component” just to render a word or a hyperlink or a shoutout or whatever - those are just template fragments in a single component. The rendering engine goes through a loop and picks out the proper fragment to render into the DOM.

How do you inject dynamically constructed HTML that requires events to be subscribed to?

$
0
0

I’ll try it out and report back.

How do you inject dynamically constructed HTML that requires events to be subscribed to?


Android Splash Screen visible as keyboard animates

$
0
0

Thanks very much for this. Works as described.
Just in time for our Play store release yesterday :slight_smile:

How to add attachment to outlook app in IOS in email from ionic

$
0
0

I am using emailComposer to implement a actions such as opening outlook app from my app with a default email having attachment on it. However the following code can only set attachment on Android, when I run it on IOS system, the the email will not having attachment shown.

const email = {
app:‘outlook’,
to: “xxx”
attachments: [“xxx”, “xxx”]
subject: “”,
body: ‘’,
isHtml: true,
};

Is there anyone know if there are any way can open outllook app with email template that having attachment on it on IOS system?

Ibeacon Plugin is working only first time

$
0
0

Hi,

I have implemented Ibeacon. For First time, Notification triggers when both mobile detects beacon. After that only one mobile is receiving notification.
Is this plugins works both in foreground/background??
Can anyone pls help me out?

Thanks

iOS Build size increasing drastically after adding this plugin to Ionic-5 project

$
0
0

@rapropos Thanks for the reply! But my app is specific to ios which wouldn’t run on any browser container. So installed this plugin for AES implementation which supports ios & android platforms.

Problem playing mp4 on IOS and Android

$
0
0

I am using Ionic/Angular and videojs along with the videojs-vr plugin.
Video playback works on all web regardless of video format.
If I use mp4 it will not display on Android devices. If I use webm it will not work on IOS devices.
I have tried multiple sources but its just grabbing the first source provided.

I understand that videojs uses HLS to stream from firebase. I don’t think it is any problem with videojs as the two different formats work on the two different devices.

What can I do to play mp4 on both devices? The videos will be high resolution and I don’t want to downgrade the quality. Is there an optimal mp4 encoded format that will playback on both?

Please help me with this.

Viewing all 228535 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>