cgkineo / adapt-pageNav

Navigation bar component (quicknav clone)
GNU General Public License v3.0
6 stars 4 forks source link

Close not unlocking on page complete #51

Closed KayConceicao closed 5 months ago

KayConceicao commented 1 year ago

Subject of the issue/enhancement/features

Describe your issue here. The close button is not unlocking when the page is complete although the next button locking is working fine.

Your environment

Steps to reproduce

Tell us how to reproduce this issue. Required page with PageNav at the bottom of the page (page is not added to plp). Close is set to unlock once page is complete. Click through components close button doesn't unlock unless you go to menu or previous page and return to page with close button.

Expected behaviour

Tell us what should happen Close button should unlock after page complete as per next button.

Actual behaviour

Tell us what happens instead Close button does not unlock even after the page is complete.

Screenshots (if you can)

oliverfoster commented 1 year ago

It sounds very much like something else is happening which is causing an error to occur in the processing of the buttons.

It's the same bit of code which manages updating both buttons, at the same time.

https://github.com/cgkineo/adapt-pageNav/blob/0eb5467f5d8dfaa72af94e1f0549e02dbb2a0fdc/js/view.js#L32 https://github.com/cgkineo/adapt-pageNav/blob/0eb5467f5d8dfaa72af94e1f0549e02dbb2a0fdc/js/model.js#L91

Any console logs?

oliverfoster commented 1 year ago

As the close button doesn't have an _id attribute it fails on this line: https://github.com/cgkineo/adapt-pageNav/blob/0eb5467f5d8dfaa72af94e1f0549e02dbb2a0fdc/js/view.js#L80

Which prevents the button from rerendering on page:_isComplete change.

I suggest just removing the line.

oliverfoster commented 1 year ago

Bug is probably fixed in upcoming pr https://github.com/cgkineo/adapt-pageNav/pull/49 But that pr is not 100% backward compatible. So as not to impede the progress of that pr, I'm not going to do a bug fix release for this right now. The only solution for a running AAT is to upload a custom version of this plugin with that bug fixed.

tomallpress commented 9 months ago

I'm still seeing this behaviour in a course I'm building in the AAT, using v2.4.0.

EDIT - interestingly, as a means of trying to get around this issue (needing to leave the page and re-enter in order to get the close button to activate), i added trickle to the last block of content on the page before the page nav. so you complete that block and then the page nav is revealed. when i do this, the close button does become active on page complete, without needing to leave and re-enter.

oliverfoster commented 5 months ago

@StuartNicholls any progress?

StuartNicholls commented 5 months ago

@oliverfoster sorry, not got to this yet

oliverfoster commented 5 months ago

v2.4.0 was the last version before the aforementioned pr, I would expect it to have the bug. pr which made v3.0.0 and should have fixed the issue: https://github.com/cgkineo/adapt-pageNav/pull/49

Have tested with latest v3.1.3, cannot replicate. pageNav close button