mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
Fixed select onchange not working
This commit is contained in:
committed by
David Sevilla Martín
parent
b952f6a2bc
commit
b7af59fe43
@@ -5,7 +5,7 @@ export interface SelectProps extends ComponentProps {
|
|||||||
/**
|
/**
|
||||||
* Disabled state for the input.
|
* Disabled state for the input.
|
||||||
*/
|
*/
|
||||||
disabled: boolean;
|
disabled?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A callback to run when the selected value is changed.
|
* A callback to run when the selected value is changed.
|
||||||
@@ -29,7 +29,7 @@ export interface SelectProps extends ComponentProps {
|
|||||||
* The `Select` component displays a <select> input, surrounded with some extra
|
* The `Select` component displays a <select> input, surrounded with some extra
|
||||||
* elements for styling.
|
* elements for styling.
|
||||||
*/
|
*/
|
||||||
export default class Select<T extends SelectProps = SelectProps> extends Component<SelectProps> {
|
export default class Select<T extends SelectProps = SelectProps> extends Component<T> {
|
||||||
view() {
|
view() {
|
||||||
return (
|
return (
|
||||||
<span className="Select">
|
<span className="Select">
|
||||||
@@ -51,7 +51,7 @@ export default class Select<T extends SelectProps = SelectProps> extends Compone
|
|||||||
/**
|
/**
|
||||||
* Run a callback when the state of the checkbox is changed.
|
* Run a callback when the state of the checkbox is changed.
|
||||||
*/
|
*/
|
||||||
protected onchange() {
|
protected onchange(value) {
|
||||||
if (this.props.onchange) this.props.onchange(this);
|
if (this.props.onchange) this.props.onchange(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user