moj-analytical-services / shinyGovstyle

Now up to GDS frontend version v4.0.0
39 stars 7 forks source link

ID generation for accordion fails when there are 10 or more sections #92

Open fingertipsy opened 1 month ago

fingertipsy commented 1 month ago

The accordion "show" buttons are not functioning correctly for sections with indices greater than 9. It seems the IDs for sections with indices greater than 9 are causing conflicts in the HTML. The result is that the "show content" button for section 11 open the content for section 1, 12 opens 2 and so forth.

jenisayshi commented 3 weeks ago

think this is caused by this line in the accordian.js code only picking up the last digit of the heading :)

// get z value from name (Map argument) var level = str.substring(str.length - 1);