fix(button): adds type

This commit is contained in:
Manu Mtz.-Almeida
2018-02-10 00:07:23 +01:00
parent 606d55c959
commit 443767c5fc
3 changed files with 31 additions and 0 deletions

View File

@ -413,6 +413,7 @@ declare global {
round?: boolean;
size?: 'small' | 'default' | 'large';
strong?: boolean;
type?: string;
}
}
}

View File

@ -15,6 +15,13 @@ export class Button {
@State() keyFocus: boolean;
/**
* The type of the button.
* Possible values are: `"submit"`, `"reset"` and `"button"`.
* Default value is: `"button"`
*/
@Prop() type = 'button';
/**
* Contains a URL or a URL fragment that the hyperlink points to.
* If this property is set, an anchor tag will be rendered.
@ -123,8 +130,13 @@ export class Button {
'focused': this.keyFocus
};
const attrs = (TagType === 'button')
? {type: 'button'}
: {};
return (
<TagType
{...attrs}
class={buttonClasses}
disabled={this.disabled}
href={this.href}

View File

@ -158,6 +158,15 @@ boolean
If true, activates a button with a heavier font weight.
#### type
string
The type of the button.
Possible values are: `"submit"`, `"reset"` and `"button"`.
Default value is: `"button"`
## Attributes
#### button-type
@ -240,6 +249,15 @@ boolean
If true, activates a button with a heavier font weight.
#### type
string
The type of the button.
Possible values are: `"submit"`, `"reset"` and `"button"`.
Default value is: `"button"`
## Events
#### ionBlur