Should table focus really reset timeSincePress?

When a table cell receives focus it resets an Action button’s timeSincePress.

But… why should it?

This behaviour gets posted about at least once a week here - and undoubtedly numerous times more for others who don’t post about it - that I think this needs some discussion.

And while i disagree with the behaviour in general I finally sat down to think about why this behaviour might have been baked in, in the first place. After thinking it over… I just couldn’t come up with a single use-case for this behaviour.

Has anyone?

Good question. Can you share where this is coming up? For a button right underneath a table, the thinking is that it should behave a lot like a submit button on a math input. Enter on the last cell submits, focus in the table unsubmits. If there are cases that you don’t want this, would love to see them!

Sure, any time an animation is involved this becomes a breaking issue.

Trivial example: Table Reset • Activity Builder by Desmos

But it has come up a lot as a common pain point, almost always due to unwanted interference in animations. Just search on this board for terms like table, reset, focus, etc. to get a sense of the scope of the frustration people have experience over this.

Thanks for taking an interest.

This person’s activity in this thread also had an issue with not displaying the correct set of dice when the table got focus:

Managed to get around this table resetting Animation business with some hacky workarounds: Suppress Animation Reset on Table Focus

But it sure would be nice to avoid this.

It’s been a few weeks to think this over Eli - do we have a reason for why cell focus should re-start animations?

It continues to be a significant hindrance to Activity creation, so I’m very curious where the use-case might be to explain this behaviour.

Thanks very much

Yes- that was a great workaround when using a graph…
but I still need an actual button (to hide objects and such) with a table on it too.
@eli_desmos any updates here?

I’m also finding the table-button relationship to be problematic for two reasons:

  1. In most of my activities I have some slides where I use a button to randomly generate numbers to give students unique problems and provide “infinite practice.” If there’s a table on the slide and a student enters values and hits enter to move to the next row then when they get to the last cell and hit enter the reset button gets triggered and they get a new problem for which all of the values they just entered are now wrong. If the button was right underneath the table then I get how one could want enter on the last cell to activate the button (like a submit button), but it causes me problems when my reset button is nowhere near the table and yet hitting enter on the last cell triggers the button no matter where it’s located (above, below, different column, etc.).

  2. Animations. Sometimes I use a button to trigger animations using timeSincePress but when students click in a table to enter values that may have just been revealed to them through the animation, the animation gets reset. I found a workaround here but I’d rather the table just not affect the button unless I deliberately make it so using resetOnChange.


1 Like