1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-29 09:10:09 +02:00

Remove hardcoded textarea height

This commit is contained in:
Peter Knut
2024-09-09 23:54:51 +02:00
parent 695a720403
commit b42762e4dc
2 changed files with 2 additions and 2 deletions

View File

@@ -978,7 +978,7 @@ function input($field, $value, $function) {
$attrs .= " cols='50' rows='12'";
} else {
$rows = min(12, substr_count($value, "\n") + 1);
$attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height
$attrs .= " cols='30' rows='$rows'";
}
echo "<textarea$attrs>" . h($value) . '</textarea>';
} elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) {

View File

@@ -10,7 +10,7 @@ class AdminerEditTextarea {
function editInput($table, $field, $attrs, $value) {
if (preg_match('~char~', $field["type"])) {
return "<textarea cols='30' rows='1' style='height: 1.2em;'$attrs>" . h($value) . '</textarea>';
return "<textarea cols='30' rows='1' $attrs>" . h($value) . '</textarea>';
}
}