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

feat(button): support autofocus property #3293

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

raoanqi
Copy link
Contributor

@raoanqi raoanqi commented Sep 12, 2024

Types of changes

  • New feature
  • Bug fix
  • Enhancement
  • Component style change
  • Typescript definition change
  • Documentation change
  • Coding style change
  • Refactoring
  • Test cases
  • Continuous integration
  • Breaking change
  • Others

Background and context

由于没有在组件内部显式控制autofocus属性,虽然autofocus属性能正常工作,但是会给devtool的数据追踪带来一定的迷惑性。通过<a-button :autofocus="true" /><a-button :autofocus="false" />这种方式使用时,devtool能够在attr中追踪到autofocus属性为true或者false,当通过<a-button autofocus>这种方式使用时,autofocus属性通过透传依然能够传递到组件上,但是此时会被devtool在attr中识别为autofocus: undefined,从而给数据的追踪带来迷惑性。

Solution

通过在组件内部显式声明该属性,能够解决该问题。

How is the change tested?

Changelog

Component Changelog(CN) Changelog(EN) Related issues
button 支持button的autofocus属性 Support autofocus attribute for button

Checklist:

  • Test suite passes (npm run test)
  • Provide changelog for relevant changes (e.g. bug fixes and new features) if applicable.
  • Changes are submitted to the appropriate branch (e.g. features should be submitted to feature branch and others
    should be submitted to main branch)

Other information

Copy link

codesandbox bot commented Sep 12, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@flsion flsion added the ✨ Feature Request New feature or request label Oct 25, 2024
@flsion flsion added this to the 2.56.3 milestone Oct 25, 2024
@flsion flsion merged commit 24633ad into arco-design:main Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants