Skip to content

Commit

Permalink
populate labels for street lines in checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
scottsb committed Mar 8, 2019
1 parent c427332 commit e1fa289
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ protected function getMultilineFieldConfig($attributeCode, array $attributeConfi
for ($lineIndex = 0; $lineIndex < (int)$attributeConfig['size']; $lineIndex++) {
$isFirstLine = $lineIndex === 0;
$line = [
'label' => __("%1: Line %2", $attributeConfig['label'], $lineIndex + 1),
'component' => 'Magento_Ui/js/form/element/abstract',
'config' => [
// customScope is used to group elements within a single form e.g. they can be validated separately
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@

// Checkout address (create shipping address)
.field.street {
.field.additional {
.field {
.label {
&:extend(.abs-visually-hidden all);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@

// Checkout address (create shipping address)
.field.street {
.field.additional {
.field {
.label {
&:extend(.abs-visually-hidden all);
}
Expand Down

2 comments on commit e1fa289

@trucatchtraps
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit only adds the label to the first line, which I think is absolutely pointless. Why try to fix something that was never broken? Now I have to try to remove it

AttributeMerger_Issue

@scottsb
Copy link
Member Author

@scottsb scottsb commented on e1fa289 Aug 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trucatchtraps It actually adds it to all the lines. And it was broken because the labels were missing, while they're required for the checkout to be accessible (which is legally mandated in many countries, including the US under the ADA).

The reason you are seeing it on only the first line is because the LESS changes from this commit are not applying in your store for some reason: most likely because you overrode this core file in your theme with a copy based on an old version. The LESS changes here cause the "visually hidden" rules to apply to all the lines, not just ones after the first. (They're only visually hidden, though: they remain accessible to assistive devices like screen readers.)

Please sign in to comment.