Skip to content

Commit

Permalink
Merge pull request #20927 from alifrumin/priceplaceholder
Browse files Browse the repository at this point in the history
Improve accessibility for price fields of the type select by adding the price field label to the placeholder.
  • Loading branch information
mlutfy authored Jul 28, 2021
2 parents 2324bb1 + 8c83065 commit af65ee6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions CRM/Price/BAO/PriceField.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,12 @@ public static function addQuickFormElement(
else {
$visibility_id = self::getVisibilityOptionID('public');
}
$element = &$qf->add('select', $elementName, $label,
[
'' => ts('- select -'),
] + $selectOption,
$useRequired && $field->is_required,
['price' => json_encode($priceVal), 'class' => 'crm-select2', 'data-price-field-values' => json_encode($customOption)]
);
$element = &$qf->add('select', $elementName, $label, $selectOption, $useRequired && $field->is_required, [
'placeholder' => ts('- select %1 -', [1 => $label]),
'price' => json_encode($priceVal),
'class' => 'crm-select2',
'data-price-field-values' => json_encode($customOption),
]);

// CRM-6902 - Add "max" option for a price set field
$button = substr($qf->controller->getButtonName(), -4);
Expand Down

0 comments on commit af65ee6

Please sign in to comment.