[DEV-5872] Catch when an element is not present
When a question has been removed, but exists in a bucket for an existing quote, it cannot find the element to hide and it ends up showing all (or mostly all) question elements. We are ignoring this case since the possible side effects of ignoring them are less severe than what happens now. Additionally, the way this works will be changing in the future.master
parent
0553060f42
commit
28cac6917f
|
@ -114,10 +114,23 @@ module.exports = Class( 'StackedGroupUi' )
|
|||
|
||||
if ( !this.hasVisibleField( index ) )
|
||||
{
|
||||
// This possible effects of ignoring these errors has been
|
||||
// deemed less severe than the current effects when it fails
|
||||
// (i.e. showing all the questions).
|
||||
// This will also eventually be changed to have the elements
|
||||
// be hidden by default and show when appropriate. This will
|
||||
// likely fix the current issue and reduce the chances of
|
||||
// something like this happening.
|
||||
try {
|
||||
const header = this._$container.find( 'dl' )[ index ];
|
||||
|
||||
header.classList.add( 'hidden' );
|
||||
}
|
||||
catch( e )
|
||||
{
|
||||
console.warn( e );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue