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(useVirtualList) - containerProp styles typing fix #2215

Closed
wants to merge 2 commits into from
Closed

fix(useVirtualList) - containerProp styles typing fix #2215

wants to merge 2 commits into from

Conversation

JMaylor
Copy link
Contributor

@JMaylor JMaylor commented Sep 16, 2022

This fixes #1467.

Before this fix, we run into a TypeScript error when running the given example in the docs, on the html element where containerProps is bound.

error TS2322: Type '{ ref: Ref<HTMLElement | null>; onScroll: () => void; style: CSSStyleDeclaration; }' is not assignable to type 'ElementAttrs<HTMLAttributes>'.  Type '{ ref: Ref<HTMLElement | null>; onScroll: () => void; style: CSSStyleDeclaration; }' is not assignable to type 'HTMLAttributes'.
    Types of property 'style' are incompatible.
      Type 'CSSStyleDeclaration' is not assignable to type 'StyleValue | undefined'.        Type 'CSSStyleDeclaration' is missing the following properties from type 'StyleValue[]': pop, push, concat, join, and 26 more.

Additional context

This bug was also causing the following error in the return statement of useVirtualList/index.ts

Expression produces a union type that is too complex to represent.ts(2590)

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@JMaylor JMaylor marked this pull request as draft September 16, 2022 22:40
@JMaylor JMaylor closed this Sep 17, 2022
@StepanMynarik
Copy link

Hi, this fix is exactly what I need!
Why was this PR just closed?

@JMaylor
Copy link
Contributor Author

JMaylor commented Oct 9, 2022

I ran into some TS issues and didn't have the time to fix them, to be honest.
I'll reopen it in case you can resolve them.

@JMaylor JMaylor reopened this Oct 9, 2022
@Surof1n
Copy link
Contributor

Surof1n commented Oct 25, 2022

hi i fixed this error in PR,

@stale
Copy link

stale bot commented Dec 24, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 24, 2022
@stale stale bot closed this Dec 31, 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.

[bug]useVirtualList 在ts中使用v-bind containerProps时类型错误
3 participants