BUG Allow extension of getAttributes for Tab and TabSet (#9954)

This commit is contained in:
Thomas Portelange 2021-10-18 12:22:01 +02:00 committed by GitHub
parent 2c1ef4df23
commit 6e2955fe14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -137,12 +137,16 @@ class Tab extends CompositeField
public function getAttributes() public function getAttributes()
{ {
return array_merge( $attributes = array_merge(
$this->attributes, $this->attributes,
[ [
'id' => $this->ID(), 'id' => $this->ID(),
'class' => 'tab ' . $this->extraClass() 'class' => 'tab ' . $this->extraClass()
] ]
); );
$this->extend('updateAttributes', $attributes);
return $attributes;
} }
} }

View File

@ -178,13 +178,17 @@ class TabSet extends CompositeField
public function getAttributes() public function getAttributes()
{ {
return array_merge( $attributes = array_merge(
$this->attributes, $this->attributes,
[ [
'id' => $this->ID(), 'id' => $this->ID(),
'class' => $this->extraClass() 'class' => $this->extraClass()
] ]
); );
$this->extend('updateAttributes', $attributes);
return $attributes;
} }
/** /**