Skip to content
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

Fix element.run_method('focus') #1093

Merged
merged 3 commits into from
Jun 27, 2023
Merged

Fix element.run_method('focus') #1093

merged 3 commits into from
Jun 27, 2023

Conversation

rodja
Copy link
Member

@rodja rodja commented Jun 27, 2023

Calling .run_method('focus') on an element stopped working with v1.2.22; worked fine with 1.2.21 as reported in #1092. This PR aims to fix the issue.

  • write a test to reproduce the issue
  • fix code
  • merge into main

@rodja rodja added the bug Something isn't working label Jun 27, 2023
@rodja rodja linked an issue Jun 27, 2023 that may be closed by this pull request
@falkoschindler
Copy link
Contributor

I fixed the methods for ui.input.
But the same problem occurs with ui.select. And QSelect has 23 methods, which all need to be forwarded. I'm still hesitant about doing that. Maybe there's a generic way of inheriting all methods from a Quasar component.

@falkoschindler
Copy link
Contributor

Now I found a (probably) better solution:

  • Every wrapped Quasar component gets a reference ref="qRef".
  • The "run_method" handler in index.html reaches into element.$refs.qRef if a method doesn't exist in the element itself.

@falkoschindler falkoschindler marked this pull request as ready for review June 27, 2023 05:55
@falkoschindler falkoschindler added this to the 1.2.24 milestone Jun 27, 2023
@rodja rodja merged commit 512d047 into main Jun 27, 2023
6 checks passed
@falkoschindler falkoschindler deleted the input_focus branch June 27, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

element.run_method('focus') not working
2 participants