Hi,
I’m trying to get a matrix question that’s in accordion/mobile view to collapse the last row when a value is entered (like it already does for all the other rows). I found a super helpful answer here, which uses this code:
var $this = jQuery(this.questionContainer);
var isMobile = jQuery(".QuestionBody", $this).is(".mobile");
jQuery(".ChoiceRow inputeid] name]", $this).on("change", function () {
if (isMobile && jQuery(this).closest(".ChoiceRow").nextAll(".ChoiceRow").length === 0) {
jQuery(this).closest(".ChoiceRow").find("thCid]").click();
}
});
This works great for me, except for one minor thing -- when the user hits the next button, the last row expands again. This happens regardless of whether I add the code to ‘addOnReady’ or ‘addOnLoad.’
Any suggestions on how to keep the last row from re-expanding would be greatly appreciated - thanks -