mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[Project code] Fixed autocomplete
This commit is contained in:
1 parent
1644c8ca52
commit
b7051216fe
1 file changed
+11
-1
@@ -11,7 +11,17 @@ export default {
|
|||||||
projectsOptions() {
|
projectsOptions() {
|
||||||
// Added to "paginate" projects, because v-autocomplete was unable to handle so many projects at once
|
// Added to "paginate" projects, because v-autocomplete was unable to handle so many projects at once
|
||||||
|
|
||||||
const projects = this.projects.filter(project => project.code.includes(this.projectCodeSearch))
|
const pattern = /[^a-zA-Z0-9 ]/g
|
||||||
|
|
||||||
|
const normalizedInput = this.projectCodeSearch
|
||||||
|
? this.projectCodeSearch.normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(pattern, '')
|
||||||
|
: ''
|
||||||
|
|
||||||
|
const projects = this.projects.filter(project => {
|
||||||
|
const normalizedProjectCode = project.code.normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(pattern, '')
|
||||||
|
return normalizedProjectCode.toLowerCase().includes(normalizedInput.toLowerCase())
|
||||||
|
})
|
||||||
|
|
||||||
let filteredProjects = projects?.length ? projects.slice(0, 10) : this.projects.slice(0, 10)
|
let filteredProjects = projects?.length ? projects.slice(0, 10) : this.projects.slice(0, 10)
|
||||||
|
|
||||||
if (!this.mastertask?.project_id)
|
if (!this.mastertask?.project_id)
|
||||||
|
|||||||
Reference in new issue
Block a user