mindwaveventures / good-thinking

Good Thinking
https://www.good-thinking.uk
4 stars 1 forks source link

E24 - Icon information doesn’t collapse #769

Closed ellemindwave closed 6 years ago

ellemindwave commented 6 years ago

Icon information doesn’t collapse

screen shot 2017-11-08 at 12 37 37

ellemindwave commented 6 years ago

@katbow E24 have testing this and it still doesn't work

iteles commented 6 years ago

@ellemindwave Do you know which browsers they tested this on so we can isolate the issue? Thanks!

ellemindwave commented 6 years ago

@iteles they tested on Chrome. Thanks

ellemindwave commented 6 years ago

It works fine if there is just one ‘i’ icon on the page that is open. The problem arises when there is more than one ‘i’ icon, and you open one, then move to open another. After opening more than one, you cannot collapse the Information again.

reddog commented 6 years ago

To reproduce, go to https://www.good-thinking.uk/self-assessment and answer as follows (in order to get to a self assessment screen with multiple i buttons):

reddog commented 6 years ago

Current behaviour appears to be:

  1. if the currently displayed self assessment page does not have an information box showing, then clicking any i button will cause the page to re-load and display an information box corresponding to the button pressed.

  2. if there is an information box showing, then:

    • clicking the first i will cause it to be hidden. Re-clicking the first i will cause the information box to be re-shown, whatever topic it relates to
    • clicking any other i will cause the self assessment page to re-load and display the information box for that button.
reddog commented 6 years ago

Seems that if we store the a_info value of the currently displayed information box (probably either as a hidden input (since there are already several of these), or an attribute on the information box HTML element, then we could check that against the a_info value of the i button being pressed and then:

  1. If an information box is being displayed:

    • if the i button being pressed has the same a_info value as the currently displayed information box, then just hide it.
    • Otherwise, perform the usual page re-load and display the newly selected information box.
  2. If an information box is not being displayed, but one has been hidden on this page then

    • if the i button being pressed has the same a_info value as the currently hidden information box, then just show it.
    • Otherwise, perform the usual page re-load and display the newly selected information box.
reddog commented 6 years ago

image