mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 04:37:42 +08:00
Fixes #14368: Added role attribute for active radio list
This commit is contained in:
committed by
Alexander Makarov
parent
1816219067
commit
f7862c16c7
@ -4,6 +4,7 @@ Yii Framework 2 Change Log
|
||||
2.0.16 under development
|
||||
------------------------
|
||||
|
||||
- Bug #14368: Added `role` attribute for active radio list (s1lver)
|
||||
- Bug #16680: Fixed ActiveField 'text' input with maxlength (s1lver)
|
||||
- Bug #5341: HasMany via two relations (shirase, cebe)
|
||||
- Bug #16558: Added cloning `yii\data\ActiveDataProvider::query` property when ActiveDataProvider object is cloned (mgrechanik)
|
||||
|
||||
@ -728,6 +728,7 @@ class ActiveField extends Component
|
||||
$this->addErrorClassIfNeeded($options);
|
||||
}
|
||||
|
||||
$this->addRoleAttributes($options, 'radiogroup');
|
||||
$this->addAriaAttributes($options);
|
||||
$this->adjustLabelFor($options);
|
||||
$this->_skipLabelFor = true;
|
||||
@ -923,6 +924,19 @@ class ActiveField extends Component
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add role attributes to the input options
|
||||
* @param $options array input options
|
||||
* @param string $role
|
||||
* @since 2.0.16
|
||||
*/
|
||||
protected function addRoleAttributes(&$options, $role)
|
||||
{
|
||||
if (!isset($options['role'])) {
|
||||
$options['role'] = $role;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds validation class to the input options if needed.
|
||||
* @param $options array input options
|
||||
|
||||
Reference in New Issue
Block a user