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

Expose tabIndex on Button and MenuItem #484

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

brandonmcconnell
Copy link
Contributor

No description provided.

Copy link

stackblitz bot commented Sep 13, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Sep 13, 2024

🦋 Changeset detected

Latest commit: 89adbb1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte-ux Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Sep 13, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
svelte-ux ✅ Ready (View Log) Visit Preview 89adbb1

Comment on lines 453 to +456
{...$$restProps}
class={_class}
style={$$props.style ?? ''}
{disabled}
tabindex={tabIndex}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... technically this is exposed via ...$$restProps, although I know intellisense doesn't really work out nice here. Any reason to add it explicitly (and as camel case vs the DOM tabindex)?

I have hopes to improve this with Svelte 5 using something like...

import type { HTMLButtonAttributes } from 'svelte/elements';

interface MyProps extends HTMLButtonAttributes  {
	required: string;
	optional?: number;
	partOfEverythingElse?: boolean;
};
let { required, optional, ...everythingElse }: MyProps = $props();

I've been using...

interface $$Props extends ComponentProps<Chart<TData>> {
  series?: typeof series;
  labels?: typeof labels;
  points?: typeof points;
  props?: typeof props;
  stackSeries?: typeof stackSeries;
}

a little in the Simplified Charts PR but it's also painful to double declare each prop, so would like to wait til Svelte 5 and $props rune before going too far down that path.

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.

2 participants