Skip to content

Commit

Permalink
Merge pull request #4634 from nextcloud-libraries/backport/4632/stable7
Browse files Browse the repository at this point in the history
[stable7] fix(NcActionInput): Set default trailing button label
  • Loading branch information
Pytal committed Oct 11, 2023
2 parents 5e04d9f + c7fae46 commit 992e65c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/components/NcActionInput/NcActionInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,9 @@ For the multiselect component, all events will be passed through. Please see the
:label="text"
:disabled="disabled"
:input-class="{ focusable: isFocusable }"
trailing-button-icon="arrowRight"
:show-trailing-button="showTrailingButton && !disabled"
v-bind="$attrs"
v-on="$listeners"
@trailing-button-click="$refs.form.requestSubmit()"
@input="onInput"
@change="onChange" />

Expand All @@ -230,6 +228,7 @@ For the multiselect component, all events will be passed through. Please see the
:input-class="{ focusable: isFocusable }"
:type="type"
trailing-button-icon="arrowRight"
:trailing-button-label="trailingButtonLabel"
:show-trailing-button="showTrailingButton && !disabled"
v-bind="$attrs"
v-on="$listeners"
Expand All @@ -252,6 +251,7 @@ import NcSelect from '../NcSelect/index.js'
import NcTextField from '../NcTextField/index.js'
import ActionGlobalMixin from '../../mixins/actionGlobal.js'
import GenRandomId from '../../utils/GenRandomId.js'
import { t } from '../../l10n.js'
export default {
name: 'NcActionInput',
Expand Down Expand Up @@ -361,12 +361,19 @@ export default {
default: null,
},
/**
* Attribute forwarded to the underlining NcPasswordField and NcTextField
* Attribute forwarded to the underlying NcPasswordField and NcTextField
*/
showTrailingButton: {
type: Boolean,
default: true,
},
/**
* Trailing button label forwarded to the underlying NcTextField
*/
trailingButtonLabel: {
type: String,
default: t('Submit'),
},
},
emits: [
Expand Down
2 changes: 1 addition & 1 deletion src/components/NcPasswordField/NcPasswordField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default {
<NcInputField v-bind="{...$attrs, ...$props }"
ref="inputField"
:type="isPasswordHidden ? 'password' : 'text'"
:show-trailing-button="showTrailingButton && true"
:show-trailing-button="showTrailingButton"
:trailing-button-label="trailingButtonLabelPassword"
:helper-text="computedHelperText"
:error="computedError"
Expand Down

0 comments on commit 992e65c

Please sign in to comment.