Disabled property on form fields should work
This commit is contained in:
parent
25963deb69
commit
c746ba5c2b
|
|
@ -366,12 +366,31 @@ class FormField
|
|||
|
||||
/**
|
||||
* Adds any circumstantial attributes to the field based on other
|
||||
* settings, such as the 'trigger' option.
|
||||
* settings, such as the 'disabled' option.
|
||||
* @param array $attributes
|
||||
* @param string $position
|
||||
* @return array
|
||||
*/
|
||||
protected function filterAttributes($attributes, $position = 'field')
|
||||
{
|
||||
$position = strtolower($position);
|
||||
|
||||
$attributes = $this->filterTriggerAttributes($attributes, $position);
|
||||
|
||||
if ($position == 'field' && $this->disabled) {
|
||||
$attributes = $attributes + ['disabled' => 'disabled'];
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds attribues used specifically by the TriggerAPI
|
||||
* @param array $attributes
|
||||
* @param string $position
|
||||
* @return array
|
||||
*/
|
||||
protected function filterTriggerAttributes($attributes, $position = 'field')
|
||||
{
|
||||
if (!$this->trigger || !is_array($this->trigger))
|
||||
return $attributes;
|
||||
|
|
|
|||
Loading…
Reference in New Issue