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(components): [input] missing autofocus types #14246

Merged
merged 2 commits into from
Sep 14, 2023
Merged

Conversation

HeftyKoo
Copy link
Member

@HeftyKoo HeftyKoo commented Sep 11, 2023

closed #14243

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

Description

🤖 Generated by Copilot at 25aecd1

This pull request adds a new autofocus prop to the ElInput component, which enables the native autofocus attribute for the input or textarea element. This prop can be used to automatically focus the input element when the component is rendered. The changes affect the files input.vue and input.ts in the packages/components/input/src directory.

Related Issue

Fixes #___.

Explanation of Changes

🤖 Generated by Copilot at 25aecd1

  • Add autofocus prop to inputProps interface to support native autofocus attribute for ElInput component (link)
  • Bind autofocus prop to autofocus attribute of native input element in input.vue template for single input and textarea cases (link, link)

@github-actions
Copy link

github-actions bot commented Sep 11, 2023

@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label Sep 11, 2023
@github-actions
Copy link

🧪 Playground Preview: https://element-plus.run/?pr=14246
Please comment the example via this playground if needed.

@btea
Copy link
Collaborator

btea commented Sep 12, 2023

The input already has attrs bound to it, I'm not sure if adding an autofocus attribute is necessary. 🤔

@HeftyKoo
Copy link
Member Author

The input already has attrs bound to it, I'm not sure if adding an autofocus attribute is necessary. 🤔

Yes, it has attrs bound to it, but adding it to the prop is for the type-safe as issue #14243 describes.

@HeftyKoo HeftyKoo merged commit 09bb91a into dev Sep 14, 2023
10 checks passed
@HeftyKoo HeftyKoo deleted the fix-input-autofocus branch September 14, 2023 02:25
@element-bot element-bot mentioned this pull request Sep 14, 2023
3 tasks
consultation-applio pushed a commit to consultation-applio/element-plus that referenced this pull request Nov 10, 2023
* fix(components): [input] missing autofocus types

closed element-plus#14243

* fix: autofocus default to false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CommitMessage::Qualified Qualified commit message
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TypeScript] [input] autocomplete causes error with vueCompilerOptions.strictTemplates enabled
2 participants