Skip to content

Commit

Permalink
Update textarea.php
Browse files Browse the repository at this point in the history
  • Loading branch information
machadoug committed Jul 5, 2021
1 parent 4291f5c commit f744f3a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions layouts/joomla/form/field/textarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
/**
* Layout variables
* -----------------
* @var int $rows rows attribute for the field.
* @var int $cols cols attribute for the field.
* @var int $maxlength maxlength attribute for the field.
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
Expand Down Expand Up @@ -65,8 +68,8 @@
}

$attributes = array(
$columns ?: '',
$rows ?: '',
$columns ? (is_numeric($columns) ? ' cols="' . $columns . '"' : $columns) : '',
$rows ? (is_numeric($rows) ? ' rows="' . $rows . '"' : $rows) : '',
!empty($class) ? 'class="form-control ' . $class . $charcounter . '"' : 'class="form-control' . $charcounter . '"',
!empty($description) ? 'aria-describedby="' . $name . '-desc"' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
Expand All @@ -78,7 +81,7 @@
!empty($autocomplete) ? 'autocomplete="' . $autocomplete . '"' : '',
$autofocus ? 'autofocus' : '',
$spellcheck ? '' : 'spellcheck="false"',
$maxlength ? 'maxlength="' . $maxlength . '"' : '',
$maxlength ? (is_numeric($maxlength) ? ' maxlength="' . $maxlength . '"' : $maxlength) : '',
!empty($counterlabel) ? $counterlabel : '',
$dataAttribute,
);
Expand Down

0 comments on commit f744f3a

Please sign in to comment.