From 6e2955fe1483fe97c46815257e5fb9986d634f0a Mon Sep 17 00:00:00 2001 From: Thomas Portelange Date: Mon, 18 Oct 2021 12:22:01 +0200 Subject: [PATCH] BUG Allow extension of getAttributes for Tab and TabSet (#9954) --- src/Forms/Tab.php | 6 +++++- src/Forms/TabSet.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Forms/Tab.php b/src/Forms/Tab.php index fc2a08a2c..bc267cbb5 100644 --- a/src/Forms/Tab.php +++ b/src/Forms/Tab.php @@ -137,12 +137,16 @@ class Tab extends CompositeField public function getAttributes() { - return array_merge( + $attributes = array_merge( $this->attributes, [ 'id' => $this->ID(), 'class' => 'tab ' . $this->extraClass() ] ); + + $this->extend('updateAttributes', $attributes); + + return $attributes; } } diff --git a/src/Forms/TabSet.php b/src/Forms/TabSet.php index bfa3a144b..f8aabcf63 100644 --- a/src/Forms/TabSet.php +++ b/src/Forms/TabSet.php @@ -178,13 +178,17 @@ class TabSet extends CompositeField public function getAttributes() { - return array_merge( + $attributes = array_merge( $this->attributes, [ 'id' => $this->ID(), 'class' => $this->extraClass() ] ); + + $this->extend('updateAttributes', $attributes); + + return $attributes; } /**