Skip to content

Commit 281fac1

Browse files
committed
refactor: do not fallback to label for placeholder on Nextcloud 32+
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent f033ae3 commit 281fac1

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/components/NcInputField/NcInputField.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import GenRandomId from '../../utils/GenRandomId.js'
101101
import AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'
102102
import Check from 'vue-material-design-icons/Check.vue'
103103
import { useModelMigration } from '../../composables/useModelMigration.ts'
104+
import { isLegacy32 } from '../../utils/legacy.ts'
104105
105106
export default {
106107
name: 'NcInputField',
@@ -297,7 +298,13 @@ export default {
297298
},
298299
299300
computedPlaceholder() {
300-
return this.hasPlaceholder ? this.placeholder : this.label
301+
if (this.hasPlaceholder) {
302+
return this.placeholder
303+
}
304+
if (isLegacy32) {
305+
return this.label
306+
}
307+
return undefined
301308
},
302309
303310
isValidLabel() {

src/components/NcTextArea/NcTextArea.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ import GenRandomId from '../../utils/GenRandomId.js'
135135
import AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'
136136
import Check from 'vue-material-design-icons/Check.vue'
137137
import { useModelMigration } from '../../composables/useModelMigration.ts'
138+
import { isLegacy32 } from '../../utils/legacy.ts'
138139
139140
export default {
140141
name: 'NcTextArea',
@@ -288,7 +289,13 @@ export default {
288289
},
289290
290291
computedPlaceholder() {
291-
return this.hasPlaceholder ? this.placeholder : this.label
292+
if (this.hasPlaceholder) {
293+
return this.placeholder
294+
}
295+
if (isLegacy32) {
296+
return this.label
297+
}
298+
return undefined
292299
},
293300
294301
isValidLabel() {

0 commit comments

Comments
 (0)