Closes: https://todo.sr.ht/~emersion/gamja/128
---
I replaced all uses of `onChange` with `onInput` in <form>s and renamed
the functions named `handleChange` to `handleInput`.
components/auth-form.js | 6 +++---
components/connect-form.js | 6 +++---
components/join-form.js | 6 +++---
components/network-form.js | 6 +++---
components/register-form.js | 6 +++---
components/settings-form.js | 6 +++---
components/verify-form.js | 6 +++---
7 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/components/auth-form.js b/components/auth-form.js
index 6eccdaa..095885f 100644
--- a/components/auth-form.js
+++ b/components/auth-form.js
@@ -9,7 +9,7 @@ export default class NetworkForm extends Component {
constructor(props) {
super(props);
- this.handleChange = this.handleChange.bind(this);
+ this.handleInput = this.handleInput.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
if (props.username) {
@@ -17,7 +17,7 @@ export default class NetworkForm extends Component {
}
}
- handleChange(event) {
+ handleInput(event) {
let target = event.target;
let value = target.type == "checkbox" ? target.checked : target.value;
this.setState({ [target.name]: value });
@@ -31,7 +31,7 @@ export default class NetworkForm extends Component {
render() {
return html`
- <form onChange=${this.handleChange} onSubmit=${this.handleSubmit}>
+ <form onInput=${this.handleInput} onSubmit=${this.handleSubmit}>
<label>
Username:<br/>
<input type="username" name="username" value=${this.state.username} required/>
diff --git a/components/connect-form.js b/components/connect-form.js
index 9283b3d..6eab2df 100644
--- a/components/connect-form.js
+++ b/components/connect-form.js
@@ -17,7 +17,7 @@ export default class ConnectForm extends Component {
constructor(props) {
super(props);
- this.handleChange = this.handleChange.bind(this);
+ this.handleInput = this.handleInput.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
if (props.params) {
@@ -32,7 +32,7 @@ export default class ConnectForm extends Component {
}
}
- handleChange(event) {
+ handleInput(event) {
let target = event.target;
let value = target.type == "checkbox" ? target.checked : target.value;
this.setState({ [target.name]: value });
@@ -147,7 +147,7 @@ export default class ConnectForm extends Component {
}
return html`
- <form onChange=${this.handleChange} onSubmit=${this.handleSubmit}>
+ <form onInput=${this.handleInput} onSubmit=${this.handleSubmit}>
<h2>Connect to IRC</h2>
<label>
diff --git a/components/join-form.js b/components/join-form.js
index 4d16f38..3676891 100644
--- a/components/join-form.js
+++ b/components/join-form.js
@@ -8,7 +8,7 @@ export default class JoinForm extends Component {
constructor(props) {
super(props);
- this.handleChange = this.handleChange.bind(this);
+ this.handleInput = this.handleInput.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
if (props.channel) {
@@ -16,7 +16,7 @@ export default class JoinForm extends Component {
}
}
- handleChange(event) {
+ handleInput(event) {
let target = event.target;
let value = target.type == "checkbox" ? target.checked : target.value;
this.setState({ [target.name]: value });
@@ -34,7 +34,7 @@ export default class JoinForm extends Component {
render() {
return html`
- <form onChange=${this.handleChange} onSubmit=${this.handleSubmit}>
+ <form onInput=${this.handleInput} onSubmit=${this.handleSubmit}>
<label>
Channel:<br/>
<input type="text" name="channel" value=${this.state.channel} autofocus required/>
diff --git a/components/network-form.js b/components/network-form.js
index a8a2dd6..1610040 100644
--- a/components/network-form.js
+++ b/components/network-form.js
@@ -22,7 +22,7 @@ export default class NetworkForm extends Component {
this.prevParams = { ...defaultParams };
- this.handleChange = this.handleChange.bind(this);
+ this.handleInput = this.handleInput.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
if (props.params) {
@@ -35,7 +35,7 @@ export default class NetworkForm extends Component {
}
}
- handleChange(event) {
+ handleInput(event) {
let target = event.target;
let value = target.type == "checkbox" ? target.checked : target.value;
this.setState({ [target.name]: value });
@@ -85,7 +85,7 @@ export default class NetworkForm extends Component {
}
return html`
- <form onChange=${this.handleChange} onSubmit=${this.handleSubmit}>
+ <form onInput=${this.handleInput} onSubmit=${this.handleSubmit}>
<label>
Hostname:<br/>
<input type="text" name="host" value=${this.state.host} autofocus required/>
diff --git a/components/register-form.js b/components/register-form.js
index 1c43395..e8537a6 100644
--- a/components/register-form.js
+++ b/components/register-form.js
@@ -9,11 +9,11 @@ export default class RegisterForm extends Component {
constructor(props) {
super(props);
- this.handleChange = this.handleChange.bind(this);
+ this.handleInput = this.handleInput.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
- handleChange(event) {
+ handleInput(event) {
let target = event.target;
let value = target.type == "checkbox" ? target.checked : target.value;
this.setState({ [target.name]: value });
@@ -27,7 +27,7 @@ export default class RegisterForm extends Component {
render() {
return html`
- <form onChange=${this.handleChange} onSubmit=${this.handleSubmit}>
+ <form onInput=${this.handleInput} onSubmit=${this.handleSubmit}>
<label>
E-mail:<br/>
<input
diff --git a/components/settings-form.js b/components/settings-form.js
index 415bd5a..31e045e 100644
--- a/components/settings-form.js
+++ b/components/settings-form.js
@@ -9,11 +9,11 @@ export default class SettingsForm extends Component {
this.state.secondsInTimestamps = props.settings.secondsInTimestamps;
this.state.bufferEvents = props.settings.bufferEvents;
- this.handleChange = this.handleChange.bind(this);
+ this.handleInput = this.handleInput.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
- handleChange(event) {
+ handleInput(event) {
let target = event.target;
let value = target.type == "checkbox" ? target.checked : target.value;
this.setState({ [target.name]: value }, () => {
@@ -56,7 +56,7 @@ export default class SettingsForm extends Component {
}
return html`
- <form onChange=${this.handleChange} onSubmit=${this.handleSubmit}>
+ <form onInput=${this.handleInput} onSubmit=${this.handleSubmit}>
<label>
<input
type="checkbox"
diff --git a/components/verify-form.js b/components/verify-form.js
index 6f64b91..6f2603e 100644
--- a/components/verify-form.js
+++ b/components/verify-form.js
@@ -9,11 +9,11 @@ export default class RegisterForm extends Component {
constructor(props) {
super(props);
- this.handleChange = this.handleChange.bind(this);
+ this.handleInput = this.handleInput.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
- handleChange(event) {
+ handleInput(event) {
let target = event.target;
let value = target.type == "checkbox" ? target.checked : target.value;
this.setState({ [target.name]: value });
@@ -27,7 +27,7 @@ export default class RegisterForm extends Component {
render() {
return html`
- <form onChange=${this.handleChange} onSubmit=${this.handleSubmit}>
+ <form onInput=${this.handleInput} onSubmit=${this.handleSubmit}>
<p>Your account <strong>${this.props.account}</strong> has been created, but a verification code is required to complete the registration.</p>
<p>${linkify(this.props.message)}</p>
--
2.39.0