Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9135125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:47:02+00:00 2026-06-17T08:47:02+00:00

The following code is behaving correctly in Chrome and Safari on my MacBook and

  • 0

The following code is behaving correctly in Chrome and Safari on my MacBook and is reacting immediately. It causes a card to flip in the browser. However on iOS the card is flipping between 3 to 8 seconds after it is tapped.

Utterly perplexed. Could it be that the minimongo instance is just too much for the iPad’s processor to handle well, this isn’t a big dataset, there is one object with a few properties in the Deck collection and 20 objects with about 10 properties in the Cards collection. All properties are short strings (less than 30 characters). I wouldn’t think this would load something with the processing capabilities of an iPad.

Also, I have a Galaxy Nexus and it runs without lag on it. Any solutions?

var flip = function (card) {
    var id = card;
    var state = Cards.findOne(id).state;
    if (state == 'flipped')
        Cards.update( id, {$set: {state: 'play'}});
    else
        Cards.update( id, {$set: {state: 'flipped'}});
};

Template.cards.events({
    'click .play': function (event) {
        flip(event.currentTarget.id);
    },
    'click .flipped': function (event) {
        flip(event.currentTarget.id);
    },
    'touchstart .play': function (event) {
        flip(event.currentTarget.id);
    },
    'touchstart .flipped': function (event) {
        flip(event.currentTarget.id);
    }
});

Template.cards.preserve({
  '.card[id]': function (node) { return node.id; },
  '.front[id]': function (node) { return node.id; },
  '.back[id]': function (node) { return node.id; },
  '.dummy[id]': function (node) { return node.id; },
});

Template.cards.cards = function () {
    var deck = Deck.findOne({ active: Session.get("activeDeck") });
    if ( deck != undefined )
        var cards = Cards.find({ deck_id: deck['_id'] }, {sort: {order: 1}}).fetch();
    else cards = {};
    return cards;
}

Template.cards.break = function () {
    return 12;
}

var Cards = new Meteor.Collection("cards");
var Deck = new Meteor.Collection("deck");

Meteor.subscribe("cards");
Meteor.subscribe("deck", function () {
    Session.set("activeDeck", 1);
});

Also, it is probably worth mentioning that on the page load there is a delay of roughly the same amount of time before any of the cards render at all.

UPDATE:
I’ve gotten into the Dev tools in safari and recorded a timeline for events and it’s reporting the following for an event received from another client via the server, there is a similar profile for the client generated change, with more steps, but both feature a roughly 3 second pause after the first Timer Fire on deps.js line 55.
(0ms start time is logging as it should on the click or on the change from another client)

Type              | Details          | Location            | Start Time | Duration
Event Dispatched  | readystatechange | sockjs-0.3.4.js:791 | 0ms        | 0.0ms
Event Dispatched  | readystatechange | sockjs-0.3.4.js:791 | 0.5ms      | 7.4ms
Event Dispatched  | readystatechange | sockjs-0.3.4.js:791 | 9.0mms     | 1.0ms
Timer Fired       | 4801             | deps.js:55          | 12.1ms     | 927ms
Timer Fired       | 4803             | sockjs-0.3.4.js:848 | 4.18s      | 6.2ms
Timer Fired       | 4804             | deps.js:55          | 4.19s      | 0.0ms

Source is now available at: https://github.com/SnappyCroissant/memoryapp

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:47:02+00:00Added an answer on June 17, 2026 at 8:47 am

    It turned out to be due to the fact the entire DOM was being redrawn (as pointed out by @Akshat in the comments above) as I passed an array rather than a cursor to the Handlebars {{#each}} loop as discovered in this question: https://stackoverflow.com/a/14307612/981731

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone please explain why the following code behaving strangely: public class UserInputTest {
the following code is not behaving like I would expect. Please help me understand
For some reason, the following bit of code isn't behaving as I would anticipate
I am not sure why the following code is not behaving the way I
The following piece of code is behaving incorrectly in my script: from ctypes import
Could someone explain why the following c++ code is not behaving as expected: struct
The following code inside an .htaccess file is behaving incorrectly.. RewriteEngine on RewriteBase /
can anybody explain why the following bash code involving compound operators is not behaving
Following code produces a nested array as a result for keys containing three items:
Following code takes like 2500 milliseconds on an i7-*3.4 GHz windows-7 64-bit computer to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.