Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/Controls/PasswordRevealInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class PasswordRevealInput extends TextInput
public const string INPUT_CLASS = 'toggle-password-input';
public const string TOGGLE_CLASS = 'toggle-password-reveal';

private static bool $scriptRendered = false;

public function __construct($label = null, ?int $maxLength = null)
{
parent::__construct($label, $maxLength);
Expand All @@ -37,12 +35,8 @@ public function getControl(): Html
$group = Html::el('div')
->setAttribute('class', 'input-group')
->addHtml($input)
->addHtml($button);

if (!self::$scriptRendered) {
self::$scriptRendered = true;
$group->addHtml(self::getScript());
}
->addHtml($button)
->addHtml(self::getScript());

return $group;
}
Expand Down