Skip to content

Commit d7841b5

Browse files
committed
PR Badgerati#251 Fixes
1 parent c72d43d commit d7841b5

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/Public/Outputs.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,10 @@ function Update-PodeWebTextbox
514514
[string]
515515
$Id,
516516

517+
[Alias('Height')]
518+
[int]
519+
$Size = 0,
520+
517521
[Parameter()]
518522
[switch]
519523
$AsJson,
@@ -542,6 +546,7 @@ function Update-PodeWebTextbox
542546
Value = $items
543547
ID = $Id
544548
Name = $Name
549+
Size = $Size
545550
AsJson = $AsJson.IsPresent
546551
Multiline = $Multiline.IsPresent
547552
}

src/Templates/Public/scripts/default.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ function setupSteppers() {
409409
btn = stepper.find('.bs-stepper-content .bs-stepper-pane.active button.step-submit');
410410
}
411411

412-
if (btn) {
412+
if (btn && !isEnterKey(e)) {
413413
btn.trigger('click');
414414
}
415415
});
@@ -2795,6 +2795,9 @@ function updateTextbox(action) {
27952795
}
27962796

27972797
txt.val(action.Value);
2798+
if (action.Multiline && action.Size > 0) {
2799+
txt[0].rows = action.Size;
2800+
}
27982801
}
27992802

28002803
function writeTextbox(action, sender) {

src/Templates/Views/elements/textbox.pode

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
$events = ConvertTo-PodeWebEvents -Events $data.Events
3232

3333
if ($data.Multiline) {
34-
$element = "<textarea class='form-control $(if ($data.NoForm) { 'no-form' })' id='$($data.ID)' name='$($data.Name)' pode-object='$($data.ObjectType)' placeholder='$($data.Placeholder)' rows='$($data.Size)' style='$($width) $($data.CssStyles)' $($describedBy) $($readOnly) $($required) $($value) $($events)></textarea>"
34+
$element = "<textarea class='form-control $(if ($data.NoForm) { 'no-form' })' id='$($data.ID)' name='$($data.Name)' pode-object='$($data.ObjectType)' placeholder='$($data.Placeholder)' rows='$($data.Size)' style='$($width) $($data.CssStyles)' $($describedBy) $($readOnly) $($required) $($events)>$($data.Value)</textarea>"
3535
}
3636
else {
3737
if ($data.Prepend.Enabled -or $data.Append.Enabled) {

0 commit comments

Comments
 (0)