#7124 - First Input Autofocus without property #251

Merged
jsegarra merged 5 commits from 7124_autofocus_first_input into dev 2024-03-25 07:17:04 +00:00
Member
No description provided.
jsegarra added 1 commit 2024-03-21 13:57:22 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
d7d83fd886
refs #7124 feat: autofocus without property
jsegarra requested review from jgallego 2024-03-21 14:02:42 +00:00
jsegarra requested review from alexm 2024-03-21 14:02:42 +00:00
jsegarra added 1 commit 2024-03-21 14:04:32 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
561a7a5286
refs #7124 perf: whitespace
jgallego requested changes 2024-03-21 14:24:43 +00:00
Dismissed
@ -0,0 +14,4 @@
// AUTOFOCUS
const elementsArray = Array.from(this.$el.elements);
const index = elementsArray.findIndex(element => element.classList.contains('q-field__native'));
Owner

refactor de chatGpt para no usar -1
const firstInputElement = elementsArray.find(element => element.classList.contains('q-field__native'));

if (firstInputElement) {

refactor de chatGpt para no usar -1 const firstInputElement = elementsArray.find(element => element.classList.contains('q-field__native')); if (firstInputElement) {
jsegarra marked this conversation as resolved
@ -0,0 +23,4 @@
// KEYUP Event
document.addEventListener('keyup', function (evt) {
if (evt.keyCode === 13) {
Owner

=== 'Enter'

=== 'Enter'
Author
Member

Este código pertenece a otra rama

Este código pertenece a otra rama
Author
Member

KeyCode is deprecated 👀

KeyCode is deprecated 👀
jsegarra marked this conversation as resolved
alexm requested changes 2024-03-22 06:05:09 +00:00
Dismissed
@ -0,0 +10,4 @@
const vm = getCurrentInstance();
if (vm.type.name === 'QForm')
if (!['searchbarForm'].includes(this.$el?.id)) {
let that = this;
Member

No usar una variable si luego solo se usa una vez. Igual se te ha quedado de antes

No usar una variable si luego solo se usa una vez. Igual se te ha quedado de antes
Author
Member

Si que se usaba en el evento key, pero eso pertenece a otra rama

Si que se usaba en el evento key, pero eso pertenece a otra rama
jsegarra marked this conversation as resolved
jsegarra changed title from #7124 - First Input Autofocus without property #2195 to #7124 - First Input Autofocus without property 2024-03-22 06:05:43 +00:00
jsegarra added 2 commits 2024-03-22 06:33:37 +00:00
jsegarra requested review from jgallego 2024-03-22 06:33:47 +00:00
jsegarra requested review from alexm 2024-03-22 06:33:48 +00:00
alexm requested changes 2024-03-22 06:54:04 +00:00
Dismissed
@ -0,0 +7,4 @@
if (!['searchbarForm','filterPanelForm'].includes(this.$el?.id)) {
// AUTOFOCUS
const elementsArray = Array.from(this.$el.elements);
const firstInputElement = elementsArray.find(element => element.classList.contains('q-field__native'));
Member

Justo he probado en claimBasicData (ejemplo: http://localhost:9000/#/claim/1/basic-data) y es curioso pq no funciona. Dado que el primer elemento si es un input pero esta disabled. Igual se podría añadir que comprobase que no tenga la clase .disabled

Justo he probado en claimBasicData (ejemplo: http://localhost:9000/#/claim/1/basic-data) y es curioso pq no funciona. Dado que el primer elemento si es un input pero esta disabled. Igual se podría añadir que comprobase que no tenga la clase `.disabled`
Author
Member

Si, es una posibilidad que había visto pero no contemplado.
Lo tengo en cuenta para mas cambios

Si, es una posibilidad que había visto pero no contemplado. Lo tengo en cuenta para mas cambios
Owner

me parece muy interesante que obvie los disables

me parece muy interesante que obvie los disables
jsegarra marked this conversation as resolved
jsegarra added 1 commit 2024-03-22 08:55:59 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
8a82b7ab38
refs #7124 perf: avoid focus in disabled fields
jsegarra requested review from alexm 2024-03-22 09:13:56 +00:00
jgallego approved these changes 2024-03-22 12:42:30 +00:00
alexm approved these changes 2024-03-25 07:04:39 +00:00
jsegarra merged commit 413beb9b84 into dev 2024-03-25 07:17:04 +00:00
jsegarra deleted branch 7124_autofocus_first_input 2024-03-25 07:17:04 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix-front#251
No description provided.