-
Notifications
You must be signed in to change notification settings - Fork 81
Fix duplicate HTML IDs and missing form labels in modal blocks #2083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
obenland
wants to merge
4
commits into
trunk
Choose a base branch
from
fix/modal-accessibility-issues
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fixed | ||
|
||
Fix duplicate HTML IDs and missing form labels in modal blocks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
use Activitypub\Blocks; | ||
use Activitypub\Collection\Actors; | ||
use Activitypub\Collection\Followers; | ||
|
||
use function Activitypub\is_activitypub_request; | ||
|
||
if ( is_activitypub_request() || is_feed() ) { | ||
|
@@ -96,7 +97,7 @@ | |
'data-wp-bind--aria-expanded' => 'context.modal.isOpen', | ||
'aria-label' => __( 'Follow me on the Fediverse', 'activitypub' ), | ||
'aria-haspopup' => 'dialog', | ||
'aria-controls' => 'modal-heading', | ||
'aria-controls' => $block_id . '-modal-title', | ||
'role' => 'button', | ||
'tabindex' => '0', | ||
) | ||
|
@@ -118,9 +119,12 @@ | |
<?php esc_html_e( 'Copy and paste my profile into the search field of your favorite fediverse app or server.', 'activitypub' ); ?> | ||
</div> | ||
<div class="activitypub-dialog__button-group"> | ||
<label for="<?php echo esc_attr( $block_id . '-profile-handle' ); ?>" class="screen-reader-text"> | ||
<?php esc_html_e( 'My Fediverse handle', 'activitypub' ); ?> | ||
</label> | ||
<input | ||
aria-readonly="true" | ||
id="profile-handle" | ||
id="<?php echo esc_attr( $block_id . '-profile-handle' ); ?>" | ||
readonly | ||
tabindex="-1" | ||
type="text" | ||
|
@@ -142,12 +146,15 @@ class="wp-element-button wp-block-button__link" | |
<?php esc_html_e( 'Or, if you know your own profile, we can start things that way!', 'activitypub' ); ?> | ||
</div> | ||
<div class="activitypub-dialog__button-group"> | ||
<label for="<?php echo esc_attr( $block_id . '-remote-profile' ); ?>" class="screen-reader-text"> | ||
<?php esc_html_e( 'Your Fediverse profile', 'activitypub' ); ?> | ||
</label> | ||
<input | ||
data-wp-bind--aria-invalid="context.isError" | ||
data-wp-bind--value="context.remoteProfile" | ||
data-wp-on--input="actions.updateRemoteProfile" | ||
data-wp-on--keydown="actions.handleKeyDown" | ||
id="remote-profile" | ||
id="<?php echo esc_attr( $block_id . '-remote-profile' ); ?>" | ||
placeholder="<?php esc_attr_e( '@[email protected]', 'activitypub' ); ?>" | ||
type="text" | ||
/> | ||
|
@@ -235,6 +242,7 @@ class="activitypub-profile__avatar u-photo" | |
// Render the modal using the Blocks class. | ||
Blocks::render_modal( | ||
array( | ||
'id' => $block_id . '-modal', | ||
'content' => $modal_content, | ||
/* translators: %s: Profile name. */ | ||
'title' => sprintf( esc_html__( 'Follow %s', 'activitypub' ), esc_html( $actor->get_name() ) ), | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ | |
*/ | ||
|
||
use Activitypub\Blocks; | ||
use function Activitypub\is_activitypub_request; | ||
|
||
if ( is_activitypub_request() || is_feed() ) { | ||
return; | ||
} | ||
|
||
/* @var array $attributes Block attributes. */ | ||
$attributes = wp_parse_args( $attributes ); | ||
|
@@ -68,9 +73,12 @@ | |
<?php esc_html_e( 'Copy and paste the Comment URL into the search field of your favorite fediverse app or server.', 'activitypub' ); ?> | ||
</div> | ||
<div class="activitypub-dialog__button-group"> | ||
<label for="<?php echo esc_attr( $block_id . '-profile-handle' ); ?>" class="screen-reader-text"> | ||
<?php esc_html_e( 'Comment URL', 'activitypub' ); ?> | ||
</label> | ||
<input | ||
aria-readonly="true" | ||
id="profile-handle" | ||
id="<?php echo esc_attr( $block_id . '-profile-handle' ); ?>" | ||
readonly | ||
tabindex="-1" | ||
type="text" | ||
|
@@ -92,12 +100,15 @@ class="wp-element-button wp-block-button__link" | |
<?php esc_html_e( 'Or, if you know your own profile, we can start things that way!', 'activitypub' ); ?> | ||
</div> | ||
<div class="activitypub-dialog__button-group"> | ||
<label for="<?php echo esc_attr( $block_id . '-remote-profile' ); ?>" class="screen-reader-text"> | ||
<?php esc_html_e( 'Your Fediverse profile', 'activitypub' ); ?> | ||
</label> | ||
<input | ||
data-wp-bind--aria-invalid="context.isError" | ||
data-wp-bind--value="context.remoteProfile" | ||
data-wp-on--input="actions.updateRemoteProfile" | ||
data-wp-on--keydown="actions.onInputKeydown" | ||
id="remote-profile" | ||
id="<?php echo esc_attr( $block_id . '-remote-profile' ); ?>" | ||
placeholder="<?php esc_attr_e( '@[email protected]', 'activitypub' ); ?>" | ||
type="text" | ||
/> | ||
|
@@ -139,6 +150,7 @@ class="activitypub-dialog__error" | |
> | ||
<div class="activitypub-remote-profile" hidden data-wp-bind--hidden="!context.hasRemoteUser"> | ||
<a | ||
href="" | ||
class="comment-reply-link activitypub-remote-profile__link" | ||
data-wp-bind--href="state.remoteProfileUrl" | ||
target="_blank" | ||
|
@@ -172,7 +184,7 @@ class="comment-reply-link activitypub-remote-reply__link" | |
data-wp-bind--aria-expanded="context.modal.isOpen" | ||
aria-label="<?php esc_attr_e( 'Reply on the Fediverse', 'activitypub' ); ?>" | ||
aria-haspopup="dialog" | ||
aria-controls="modal-heading" | ||
aria-controls="<?php echo esc_attr( $block_id . '-modal-title' ); ?>" | ||
role="button" | ||
tabindex="0" | ||
hidden | ||
|
@@ -183,6 +195,7 @@ class="comment-reply-link activitypub-remote-reply__link" | |
<?php | ||
Blocks::render_modal( | ||
array( | ||
'id' => $block_id . '-modal', | ||
'title' => __( 'Remote Reply', 'activitypub' ), | ||
'content' => $modal_content, | ||
) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,7 +97,7 @@ | |
'data-wp-bind--aria-expanded' => 'context.modal.isOpen', | ||
'aria-label' => __( 'Follow me on the Fediverse', 'activitypub' ), | ||
'aria-haspopup' => 'dialog', | ||
'aria-controls' => 'modal-heading', | ||
'aria-controls' => $block_id . '-modal-title', | ||
'role' => 'button', | ||
'tabindex' => '0', | ||
) | ||
|
@@ -119,9 +119,12 @@ | |
<?php esc_html_e( 'Copy and paste my profile into the search field of your favorite fediverse app or server.', 'activitypub' ); ?> | ||
</div> | ||
<div class="activitypub-dialog__button-group"> | ||
<label for="<?php echo esc_attr( $block_id . '-profile-handle' ); ?>" class="screen-reader-text"> | ||
<?php esc_html_e( 'My Fediverse handle', 'activitypub' ); ?> | ||
</label> | ||
<input | ||
aria-readonly="true" | ||
id="profile-handle" | ||
id="<?php echo esc_attr( $block_id . '-profile-handle' ); ?>" | ||
readonly | ||
tabindex="-1" | ||
type="text" | ||
|
@@ -143,12 +146,15 @@ class="wp-element-button wp-block-button__link" | |
<?php esc_html_e( 'Or, if you know your own profile, we can start things that way!', 'activitypub' ); ?> | ||
</div> | ||
<div class="activitypub-dialog__button-group"> | ||
<label for="<?php echo esc_attr( $block_id . '-remote-profile' ); ?>" class="screen-reader-text"> | ||
<?php esc_html_e( 'Your Fediverse profile', 'activitypub' ); ?> | ||
</label> | ||
<input | ||
data-wp-bind--aria-invalid="context.isError" | ||
data-wp-bind--value="context.remoteProfile" | ||
data-wp-on--input="actions.updateRemoteProfile" | ||
data-wp-on--keydown="actions.handleKeyDown" | ||
id="remote-profile" | ||
id="<?php echo esc_attr( $block_id . '-remote-profile' ); ?>" | ||
placeholder="<?php esc_attr_e( '@[email protected]', 'activitypub' ); ?>" | ||
type="text" | ||
/> | ||
|
@@ -236,6 +242,7 @@ class="activitypub-profile__avatar u-photo" | |
// Render the modal using the Blocks class. | ||
Blocks::render_modal( | ||
array( | ||
'id' => $block_id . '-modal', | ||
'content' => $modal_content, | ||
/* translators: %s: Profile name. */ | ||
'title' => sprintf( esc_html__( 'Follow %s', 'activitypub' ), esc_html( $actor->get_name() ) ), | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
*/ | ||
|
||
use Activitypub\Blocks; | ||
use function Activitypub\is_activitypub_request; | ||
|
||
if ( is_activitypub_request() || is_feed() ) { | ||
return; | ||
|
@@ -72,9 +73,12 @@ | |
<?php esc_html_e( 'Copy and paste the Comment URL into the search field of your favorite fediverse app or server.', 'activitypub' ); ?> | ||
</div> | ||
<div class="activitypub-dialog__button-group"> | ||
<label for="<?php echo esc_attr( $block_id . '-profile-handle' ); ?>" class="screen-reader-text"> | ||
<?php esc_html_e( 'Comment URL', 'activitypub' ); ?> | ||
</label> | ||
<input | ||
aria-readonly="true" | ||
id="profile-handle" | ||
id="<?php echo esc_attr( $block_id . '-profile-handle' ); ?>" | ||
readonly | ||
tabindex="-1" | ||
type="text" | ||
|
@@ -96,12 +100,15 @@ class="wp-element-button wp-block-button__link" | |
<?php esc_html_e( 'Or, if you know your own profile, we can start things that way!', 'activitypub' ); ?> | ||
</div> | ||
<div class="activitypub-dialog__button-group"> | ||
<label for="<?php echo esc_attr( $block_id . '-remote-profile' ); ?>" class="screen-reader-text"> | ||
<?php esc_html_e( 'Your Fediverse profile', 'activitypub' ); ?> | ||
</label> | ||
<input | ||
data-wp-bind--aria-invalid="context.isError" | ||
data-wp-bind--value="context.remoteProfile" | ||
data-wp-on--input="actions.updateRemoteProfile" | ||
data-wp-on--keydown="actions.onInputKeydown" | ||
id="remote-profile" | ||
id="<?php echo esc_attr( $block_id . '-remote-profile' ); ?>" | ||
placeholder="<?php esc_attr_e( '@[email protected]', 'activitypub' ); ?>" | ||
type="text" | ||
/> | ||
|
@@ -143,6 +150,7 @@ class="activitypub-dialog__error" | |
> | ||
<div class="activitypub-remote-profile" hidden data-wp-bind--hidden="!context.hasRemoteUser"> | ||
<a | ||
href="" | ||
class="comment-reply-link activitypub-remote-profile__link" | ||
data-wp-bind--href="state.remoteProfileUrl" | ||
target="_blank" | ||
|
@@ -176,7 +184,7 @@ class="comment-reply-link activitypub-remote-reply__link" | |
data-wp-bind--aria-expanded="context.modal.isOpen" | ||
aria-label="<?php esc_attr_e( 'Reply on the Fediverse', 'activitypub' ); ?>" | ||
aria-haspopup="dialog" | ||
aria-controls="modal-heading" | ||
aria-controls="<?php echo esc_attr( $block_id . '-modal-title' ); ?>" | ||
role="button" | ||
tabindex="0" | ||
hidden | ||
|
@@ -187,6 +195,7 @@ class="comment-reply-link activitypub-remote-reply__link" | |
<?php | ||
Blocks::render_modal( | ||
array( | ||
'id' => $block_id . '-modal', | ||
'title' => __( 'Remote Reply', 'activitypub' ), | ||
'content' => $modal_content, | ||
) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.