mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 18:22:37 -04:00
Previously attempted in this commit by changing the element to a <section>: https://github.com/alphagov/notifications-admin/commit/e815a7323311a4487addd5bb99ee72b7412775fc This broke the updateContent.js, that polls the JSON endpoint for the partial and updates its content with changes sent back. From what I could tell, it broke it because the JS that does the update gets the diff between the current partial and the one sent in JSON and applies it to the current one. If the notification hasn't completed before the page loads, the partial added to the page has a <div> wrapping it, to initalise the updateContent.js JS. This means the diff ends up being between elements with a different level of hierarchy: Element 1: <div data-module="update-content"> <div class="ajax-block-container"> ... </div> </div> Element 2: <div class="ajax-block-container"> ... </div> This seems to work OK when the partial is a <div>, I assume because it's the same type of element as the wrapper, but not when it's a <section>: Element 1: <div data-module="update-content"> <section class="ajax-block-container"> ... </section> </div> Element 2: <section class="ajax-block-container"> ... </section> Because of all this, it's easier to just give it the role of 'region'.
2.9 KiB
2.9 KiB