Skip to content

Conversation

@atnartur
Copy link
Contributor

@atnartur atnartur commented Mar 29, 2020

Focus event may be useful for loading initial data for list instead of using mounted hook for that case.

Also I added id attribute for input for use with <label for="...">.

@mattzollinhofer
Copy link
Owner

mattzollinhofer commented Apr 9, 2020

I'm interested in this PR, but I'd like to understand it better.

Could you give a little more information about how'd you see using this event? I definitely think more events could be useful (#28), but I want to make sure we understand the use cases really well before adding too many. An API is a fragile thing, too few and there aren't enough options, too many and it's a mess to wade through.

Additionally, I know it seems petty, but could you make a separate PR for the id change? I mostly try to keep PRs to a single related purpose. The id change you suggested makes me think about the whole concept of labels and ids and whether or not there should be a name attribute as well. Also, what, if any, the default for those properties should be. But, I'd like to separate that discussion from the conversation about the focus event.

@KylSanAntonio
Copy link

Hi, I am planning to create another issue but I saw this. I don't know if the "focus event" is the same with my issue.

So I tried to implement the typeahead in modal and I would like to have it in autofocus. So when the modal loads, the focus should be on the typeahead.

Is there a workaround to do this as I tried to add an ID but it doesn't add/append in the input element itself.

@mattzollinhofer
Copy link
Owner

@darrinmn9, I know you were interested in this PR. I wasn't sure if you were interested in this implementation of the general idea. I'm onboard with the idea, but the PR could use a couple of touchups as I noted in my original comment.

@darrinmn9
Copy link
Contributor

agreed, and like you said, it should probably be 2 separate PRs, 1 for the @focus event and 1 for the allowing a user specified id to be passed to the input (which is valuable for accessibility to tie a <label for="..."> with the specific input).

drikusroor added a commit that referenced this pull request Aug 20, 2022
drikusroor added a commit that referenced this pull request Aug 20, 2022
drikusroor added a commit that referenced this pull request Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants