-
-
Notifications
You must be signed in to change notification settings - Fork 31
Small fixes to PodeWebTextbox #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 11 commits
ab8f83b
c94e02f
80b554f
212555c
5fe11ea
d9a0671
263b0be
d877325
57f8559
112ed83
8fdfa89
e41dbaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -514,6 +514,10 @@ function Update-PodeWebTextbox | |
[string] | ||
$Id, | ||
|
||
[Alias('Height')] | ||
[int] | ||
$Size = 4, | ||
|
||
[Parameter()] | ||
[switch] | ||
$AsJson, | ||
|
@@ -536,12 +540,17 @@ function Update-PodeWebTextbox | |
$items = ($items | Out-String) | ||
} | ||
|
||
if ($Size -le 0) { | ||
$Size = 4 | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can remove this part if default size is 0. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
|
||
return @{ | ||
Operation = 'Update' | ||
ObjectType = 'Textbox' | ||
Value = $items | ||
ID = $Id | ||
Name = $Name | ||
Size = $Size | ||
AsJson = $AsJson.IsPresent | ||
Multiline = $Multiline.IsPresent | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
btn.trigger('click'); | ||
} | ||
}); | ||
|
@@ -2795,6 +2795,9 @@ function updateTextbox(action) { | |
} | ||
|
||
txt.val(action.Value); | ||
if (Number.isInteger(action.Size)) { | ||
txt[0].rows = action.Size; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Size parameter is an if (action.Multiline && action.Size > 0) {
txt[0].rows = action.Size;
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
} | ||
|
||
function writeTextbox(action, sender) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) $($value) $($events)>$($data.Value)</textarea>" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably worth removing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
} | ||
else { | ||
if ($data.Prepend.Enabled -or $data.Append.Enabled) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make it so the default here is
0
, so we can skip updating the textarea if no Size is passed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed