X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=empathy%2Fempathy.jsx;h=84a35a5eab96f71fd37336ce6f4bcef37312a85b;hp=cd8062959ec67cab269d4e95db44c3167f0e49e2;hb=a1ed0fc881f3bfe6cc55041fda3b54f7c0baa94b;hpb=68a66356ecb9d184e44b8d75e1f7db25926d4af3 diff --git a/empathy/empathy.jsx b/empathy/empathy.jsx index cd80629..84a35a5 100644 --- a/empathy/empathy.jsx +++ b/empathy/empathy.jsx @@ -125,6 +125,19 @@ async function fetch_put_json(api = '', data = {}) { class CategoryRequest extends React.Component { constructor(props) { super(props); + this.category = React.createRef(); + + this.handle_submit = this.handle_submit.bind(this); + } + + handle_submit(event) { + const category_input = this.category.current; + const category = category_input.value; + + /* Prevent the default page-changing form-submission behavior. */ + event.preventDefault(); + + console.log("Do something here with category: " + category); } render() { @@ -136,7 +149,7 @@ class CategoryRequest extends React.Component { include the number of items for each person to submit.

-
+
- + ref={this.category} + />