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

use HTMLAttributes instead of HTMLProps #2269

Merged
merged 5 commits into from
Mar 19, 2018
Merged

use HTMLAttributes instead of HTMLProps #2269

merged 5 commits into from
Mar 19, 2018

Conversation

giladgray
Copy link
Contributor

@giladgray giladgray commented Mar 19, 2018

part of #2266. fixes #2181.

ensure HTMLAttributes appears last in extends list (otherwise it breaks the interface tables)

ensure HTMLAttrs appears last in extends list
@blueprint-bot
Copy link

fix buttons HTMLAttributes

Preview: documentation | landing | table

@blueprint-bot
Copy link

Card supports HTML props

Preview: documentation | landing | table

@@ -56,7 +56,10 @@ export interface IButtonState {
isActive: boolean;
}

export abstract class AbstractButton<T> extends React.Component<React.HTMLProps<T> & IButtonProps, IButtonState> {
export abstract class AbstractButton<H extends React.HTMLAttributes<any>> extends React.PureComponent<
Copy link
Contributor

Choose a reason for hiding this comment

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

🤯

Copy link
Contributor Author

Choose a reason for hiding this comment

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

emoji didn't come though, it's just a square. what's the sentiment here?

Copy link
Contributor

@llorca llorca Mar 19, 2018

Choose a reason for hiding this comment

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

image

(High Sierra update is worth the new emojis. Maybe.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yes very nice

@@ -10,8 +10,7 @@ import * as Classes from "../../common/classes";
import { IProps } from "../../common/props";

// allow the empty interface so we can label it clearly in the docs
// tslint:disable-next-line:no-empty-interface
export interface INavbarDividerProps extends React.HTMLProps<HTMLDivElement>, IProps {
export interface INavbarDividerProps extends IProps, React.HTMLAttributes<HTMLDivElement> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pro tip: div and span don't have special attrs so they both use HTMLAttributes<T> but other elements like label or input have their own LabelHTMLAttributes<T> interfaces

@blueprint-bot
Copy link

HTMLDivProps type alias

Preview: documentation | landing | table

Copy link
Contributor

@themadcreator themadcreator left a comment

Choose a reason for hiding this comment

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

Just the one change, then LGTM

@@ -48,7 +48,7 @@ export interface IInputGroupState {
rightElementWidth?: number;
}

export class InputGroup extends React.PureComponent<HTMLInputProps & IInputGroupProps, IInputGroupState> {
export class InputGroup extends React.PureComponent<IInputGroupProps & HTMLInputProps, IInputGroupState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

extend interface instead of & the types (as per convention elsewhere)

@blueprint-bot
Copy link

comment about input group props

Preview: documentation | landing | table

@giladgray giladgray merged commit 3326d66 into develop Mar 19, 2018
@giladgray giladgray deleted the gg/html-props branch March 19, 2018 23:19
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.

Card missing onDragStart, onMouseEnter, and onMouseLeave event handlers
4 participants