-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Small fixes to PodeWebTextbox #251
base: develop
Are you sure you want to change the base?
Conversation
PR57f85591
Hey @ittchmh, I should be able to review this tomorrow, one quick thing though, could you update the PR to point at the develop branch? :) |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth removing the $($value)
property being set here.
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
src/Public/Outputs.ps1
Outdated
[Alias('Height')] | ||
[int] | ||
$Size = 4, |
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
src/Public/Outputs.ps1
Outdated
if ($Size -le 0) { | ||
$Size = 4 | ||
} |
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.
Can remove this part if default size is 0.
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
if (Number.isInteger(action.Size)) { | ||
txt[0].rows = action.Size; | ||
} |
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.
The Size parameter is an [int]
so the Number check isn't needed. It was also be worth checking that the textbox is a textarea as well, something like:
if (action.Multiline && action.Size > 0) {
txt[0].rows = action.Size;
}
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
@@ -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 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 🤔
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.
Hey @Badgerati, I tried to switch to develop brunch and revert master, but something was done wrong by me. 😕 |
Description of the Change
Updates: