From 68041f4265c217edb3a6be9194cc893eaa8ee59b Mon Sep 17 00:00:00 2001 From: Saophalkun Ponlu Date: Wed, 26 Apr 2017 13:54:06 +1200 Subject: [PATCH 1/2] Wrap selection group input in label --- src/Forms/SelectionGroup.php | 10 +--------- templates/SilverStripe/Forms/SelectionGroup.ss | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Forms/SelectionGroup.php b/src/Forms/SelectionGroup.php index 998e4f254..81a5c309f 100644 --- a/src/Forms/SelectionGroup.php +++ b/src/Forms/SelectionGroup.php @@ -101,17 +101,9 @@ class SelectionGroup extends CompositeField 'name' => $this->name, 'value' => $item->getValue(), 'checked' => $checked, - 'aria-labelledby' => "title-{$itemID}", ) )), - "RadioLabel" => DBField::create_field('HTMLFragment', FormField::create_tag( - 'label', - array( - 'id' => "title-{$itemID}", - 'for' => $itemID - ), - $item->getTitle() - )), + "RadioLabel" => $item->getTitle(), "Selected" => $firstSelected, ); $newItems[] = $item->customise($extra); diff --git a/templates/SilverStripe/Forms/SelectionGroup.ss b/templates/SilverStripe/Forms/SelectionGroup.ss index 8201cf936..8147c9a62 100644 --- a/templates/SilverStripe/Forms/SelectionGroup.ss +++ b/templates/SilverStripe/Forms/SelectionGroup.ss @@ -13,7 +13,7 @@