Browse Source

Fixes #196: Remove `role="form"` from `yii\bootstrap\ActiveForm` according to new aria specification

tags/2.0.7
bastardijke 8 years ago committed by Alexander Makarov
parent
commit
65d43badb6
  1. 4
      ActiveForm.php
  2. 1
      CHANGELOG.md
  3. 32
      tests/ActiveFormTest.php

4
ActiveForm.php

@ -70,9 +70,9 @@ class ActiveForm extends \yii\widgets\ActiveForm
*/
public $fieldClass = 'yii\bootstrap\ActiveField';
/**
* @var array HTML attributes for the form tag. Default is `['role' => 'form']`.
* @var array HTML attributes for the form tag. Default is `[]`.
*/
public $options = ['role' => 'form'];
public $options = [];
/**
* @var string the form layout. Either 'default', 'horizontal' or 'inline'.
* By choosing a layout, an appropriate default field configuration is applied. This will

1
CHANGELOG.md

@ -12,6 +12,7 @@ Yii Framework 2 bootstrap extension Change Log
- Bug #143: Fixed `yii\bootstrap\Nav` to use tags according to bootstrap docs (PowerGamer1)
- Bug #162: Fixed `yii\bootstrap\Nav` not taking explicit `active` into account when `activateItems` is off (samdark)
- Enh #174: Added `yii\bootstrap\Tabs::renderPanes()` to allow extending the class to manipulate the content between the tabs and the content (thiagotalma)
- Bug #196: Remove `role="form"` from `yii\bootstrap\ActiveForm` according to new aria specification (bastardijke)
2.0.6 March 17, 2016
--------------------

32
tests/ActiveFormTest.php

@ -0,0 +1,32 @@
<?php
namespace yiiunit\extensions\bootstrap;
use yii\bootstrap\ActiveForm;
/**
* Tests for ActiveForm widget
*
* @group bootstrap
*/
class ActiveFormTest extends TestCase
{
protected function setUp()
{
// dirty way to have Request object not throwing exception when running testFormNoRoleAttribute()
$_SERVER['REQUEST_URI'] = "index.php";
parent::setUp();
}
/**
* Fixes #196
*/
public function testFormNoRoleAttribute()
{
$form = ActiveForm::widget();
$this->assertNotContains('role="form"', $form);
}
}
Loading…
Cancel
Save