Skip to content

Commit

Permalink
removed fix for IE
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 5, 2023
1 parent c4efb9d commit d820224
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 78 deletions.
4 changes: 0 additions & 4 deletions src/Bridges/FormsLatte/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ public static function renderFormEnd(Form $form, bool $withTags = true): string
}
}

if (iterator_count($form->getComponents(true, Nette\Forms\Controls\TextInput::class)) < 2) {
$s .= "<!--[if IE]><input type=IEbug disabled style=\"display:none\"><![endif]-->\n";
}

return $s . ($withTags ? $form->getElementPrototype()->endTag() . "\n" : '');
}

Expand Down
4 changes: 0 additions & 4 deletions src/Forms/Rendering/DefaultFormRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@ public function renderEnd(): string
}
}

if (iterator_count($this->form->getComponents(true, Nette\Forms\Controls\TextInput::class)) < 2) {
$s .= '<!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->';
}

if ($s) {
$s = $this->getWrapper('hidden container')->setHtml($s) . "\n";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Forms.Latte2/expected/FormMacros.button.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
<button type="submit" name="send" value="Sign in"></button>

<button type="submit" name="send" value="Sign in">Sign in</button>
%A%
</form>
</form>
16 changes: 5 additions & 11 deletions tests/Forms.Latte2/expected/FormMacros.forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@
<input type="text" name="username" class="control-class" id="frm-username">

<label>My</label><input name=My>
<!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>



<form action="" method="post" class="form-class"><input type="hidden" name="id" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<form action="" method="post" class="form-class"><input type="hidden" name="id" value=""></form>


<form action="" method="post" class="form-class">
Expand Down Expand Up @@ -92,20 +90,17 @@

<form id="myForm" class="ajax" action="" method="post">
<input type="text" name="username" class="control-class" id="frm-username">
<input type="hidden" name="id" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<input type="hidden" name="id" value=""></form>


<form class="nclass" action="" method="post">
<input type="text" name="username" id="frm-username" class="nclass">
<input type="hidden" name="id" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<input type="hidden" name="id" value=""></form>


<FORM action="" method="post" class="form-class">
<input type="text" name="username" class="control-class" id="frm-username">
<input type="hidden" name="id" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</FORM>
<input type="hidden" name="id" value=""></FORM>


<select name="select" id="frm-select"><option value="m">male</option><option value="f">female</option></select>
Expand All @@ -115,10 +110,9 @@


<select name="select" id="frm-select"><option value="m">male</option><option value="f">female</option></select>
<!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>



<label>Sex:</label>
<input type="text" name="username" class="control-class" id="frm-username">
<input type="text" name="username" class="control-class" id="frm-username">
6 changes: 2 additions & 4 deletions tests/Forms.Latte2/expected/FormMacros.get.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<form action="" method="get"><input type="hidden" name="arg" value="val"><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<form action="" method="get"><input type="hidden" name="arg" value="val"></form>


<form action="" method="get">
<input type="hidden" name="arg" value="val"><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<input type="hidden" name="arg" value="val"></form>
1 change: 0 additions & 1 deletion tests/Forms.Latte3/expected/forms.button.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
<button type="submit" name="send" value="Sign in"></button>

<button type="submit" name="send" value="Sign in">Sign in</button>
%A%
</form>
6 changes: 2 additions & 4 deletions tests/Forms.Latte3/expected/forms.get.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<form action="" method="get"><input type="hidden" name="arg" value="val"><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<form action="" method="get"><input type="hidden" name="arg" value="val"></form>


<form action="" method="get">
<input type="hidden" name="arg" value="val"><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<input type="hidden" name="arg" value="val"></form>
16 changes: 5 additions & 11 deletions tests/Forms.Latte3/expected/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@
<input type="text" name="username" class="control-class" id="frm-username">

<label>My</label><input name=My>
<!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>



<form action="" method="post" class="form-class"><input type="hidden" name="id" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<form action="" method="post" class="form-class"><input type="hidden" name="id" value=""></form>


<form action="" method="post" class="form-class">
Expand Down Expand Up @@ -88,20 +86,17 @@

<form action="" method="post" id="myForm" class="ajax">
<input type="text" name="username" class="control-class" id="frm-username">
<input type="hidden" name="id" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<input type="hidden" name="id" value=""></form>


<form action="" method="post" class="nclass">
<input type="text" name="username" id="frm-username" class="nclass">
<input type="hidden" name="id" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>
<input type="hidden" name="id" value=""></form>


<FORM action="" method="post" class="form-class">
<input type="text" name="username" class="control-class" id="frm-username">
<input type="hidden" name="id" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</FORM>
<input type="hidden" name="id" value=""></FORM>


<select name="select" id="frm-select"><option value="m">male</option><option value="f">female</option></select>
Expand All @@ -111,11 +106,10 @@


<select name="select" id="frm-select"><option value="m">male</option><option value="f">female</option></select>
<!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
</form>




<label>Sex:</label>
<input type="text" name="username" class="control-class" id="frm-username">
<input type="text" name="username" class="control-class" id="frm-username">
35 changes: 0 additions & 35 deletions tests/Forms/Forms.renderer.3.phpt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Forms/Forms.renderer.4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Assert::match('<form action="link" method="get">
</tr>
</table>
<input type="hidden" name="userid" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
<input type="hidden" name="userid" value="">
</form>', $form->__toString(true));

Assert::same('link?a=b&c[]=d&list[0]=1', $form->getAction());
2 changes: 1 addition & 1 deletion tests/Forms/Forms.renderer.6.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Assert::match('<form action="link" method="get">
</tr>
</table>
<input type="hidden" name="userid" value=""><!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->
<input type="hidden" name="userid" value="">
</form>', $form->__toString(true));

Assert::same('link', $form->getAction());

0 comments on commit d820224

Please sign in to comment.