Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/Public/Outputs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ function Update-PodeWebTextbox
[string]
$Id,

[Alias('Height')]
[int]
$Size = 0,

[Parameter()]
[switch]
$AsJson,
Expand Down Expand Up @@ -542,6 +546,7 @@ function Update-PodeWebTextbox
Value = $items
ID = $Id
Name = $Name
Size = $Size
AsJson = $AsJson.IsPresent
Multiline = $Multiline.IsPresent
}
Expand Down
5 changes: 4 additions & 1 deletion src/Templates/Public/scripts/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ function setupSteppers() {
btn = stepper.find('.bs-stepper-content .bs-stepper-pane.active button.step-submit');
}

if (btn) {
if (btn && !isEnterKey(e)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the !isEnterKey(e) needed here? As ~9 lines up we do the same check and return 🤔

Copy link
Author

@ittchmh ittchmh Dec 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the && !isEnterKey(e) not set, it adding new line and execute Next button actio
7rAOMmPD46
n

btn.trigger('click');
}
});
Expand Down Expand Up @@ -2795,6 +2795,9 @@ function updateTextbox(action) {
}

txt.val(action.Value);
if (action.Multiline && action.Size > 0) {
txt[0].rows = action.Size;
}
}

function writeTextbox(action, sender) {
Expand Down
2 changes: 1 addition & 1 deletion src/Templates/Views/elements/textbox.pode
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$events = ConvertTo-PodeWebEvents -Events $data.Events

if ($data.Multiline) {
$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>"
$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>"
}
else {
if ($data.Prepend.Enabled -or $data.Append.Enabled) {
Expand Down