Skip to content
Snippets Groups Projects

Dialog buttons do not inherit accessibility-related attributes

Open Clay Freeman requested to merge issue/drupal-3460846:3460846-dialog-buttons-do into 11.x
2 unresolved threads

Closes #3460846

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
103 103 text: $originalButton.html() || $originalButton.attr('value'),
104 104 class: $originalButton.attr('class'),
105 105 'data-once': $originalButton.data('once'),
106 'aria-description': $originalButton.attr('aria-description'),
107 'aria-details': $originalButton.attr('aria-details'),
  • maybe copy all data-attributes?

     const originalDataAttributes = $originalButton[0].dataset; 
    
      const buttonData = {
        text: $originalButton.html() || $originalButton.attr('value'),
        class: $originalButton.attr('class'),
         ...Object.fromEntries(Object.entries(originalDataAttributes)),
        ),
    
    Edited by Ivan Berdinsky
  • seems it will not work for aria-attributes.

  • Drupal would need to be able to assume that this is something which is safe to do, and I'm not convinced that it is. Additionally, this proposed change widens the scope of the issue I'm trying to resolve, so I think it deserves a separate issue.

  • Please register or sign in to reply
  • 195 198 $has_focus_text = $this->getSession()->evaluateScript('document.activeElement.textContent');
    196 199 $this->assertEquals('Do it', $has_focus_text);
    197 200
    201 $expected_attrs = [
    202 'aria-description' => 'Example description',
    203 'aria-details' => 'ajax-form-description',
    204 'aria-label' => 'Example label',
    205 'title' => 'Example hover text',
    206 ];
    207
    208 $hello_world = $this->assertSession()->elementExists('css', '.ui-dialog-buttonpane')->findButton('Hello world');
  • added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading