adaptlearning / adapt-contrib-narrative

A component that displays an image gallery with accompanying text
GNU General Public License v3.0
5 stars 39 forks source link

fixes ABU-1142 #155

Closed sarveshwar-gavhane closed 8 years ago

sarveshwar-gavhane commented 8 years ago

.accessibility-state span gets removed and Re-added, from pre render resizeControl is calling twice replaceInstructions that's why tabindex value is not updated it is Re-added, due to this The focus returns to the top of the page, then to the instruction text on the narrative component, and then finally on to the close button within the hotgraphic popup.

sarveshwar-gavhane commented 8 years ago

@oliverfoster come up with another way could you have a look on this.

dancgray commented 8 years ago

@sarveshwar-gavhane @oliverfoster what is the status of this PR? Are we waiting for more changes.

sarveshwar-gavhane commented 8 years ago

@dancgray actually _.once(this.replaceInstructions); works for me, but let's see if @oliverfoster suggest any other solution ? otherwise we can merge this pull request.

moloko commented 8 years ago

@sarveshwar-gavhane putting something like

_.once(this.replaceInstructions);

is effectively much the same as doing

//this.replaceInstructions();

This is because _.once is a bit like _.bind i.e. it creates a new copy of the function you pass to it - so if you don't then assign it & call it, nothing will happen

oliverfoster commented 8 years ago

As Matt said, I don't think this code solves the issue in the intended way. The window-resize and swap-for-hotgraphic sections need to be separated to make this issue clearer. The component is running some swap-for-hotgraphic code on a window-resize, (which is triggered a number of times, even if the window isn't resized).

chris-steele commented 8 years ago

Hey guys, mind checking https://github.com/adaptlearning/adapt-contrib-narrative/pull/156 - hopefully will resolve this issue. Thanks.

moloko commented 8 years ago

cheers @chris-steele will have a look later today