Merge pull request #1312 from holyavocad0/patch-1

FIX Update EditableFormHeading.php to output unique ID attributes to comply with accessibility standards
This commit is contained in:
Guy Sartorelli 2024-08-14 11:58:52 +12:00 committed by GitHub
commit f5cfc22aba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,7 +70,7 @@ class EditableFormHeading extends EditableFormField
public function getFormField() public function getFormField()
{ {
$labelField = HeaderField::create('userforms-header', $this->Title ?: false) $labelField = HeaderField::create('userforms-header-' . $this->ID, $this->Title ?: false)
->setHeadingLevel($this->Level); ->setHeadingLevel($this->Level);
$labelField->addExtraClass('FormHeading'); $labelField->addExtraClass('FormHeading');
$labelField->setAttribute('data-id', $this->Name); $labelField->setAttribute('data-id', $this->Name);