Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tsml-ui",
"version": "1.7.10",
"version": "1.7.11",
"private": false,
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/app.js

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions src/components/Controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ export default function Controls({ state, setState, mapbox }: ControlsProps) {
const locationSearch = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();

if (state.input.mode === 'location') {
setState({
...state,
input: {
...state.input,
latitude: undefined,
longitude: undefined,
search: search,
},
});
}
if (state.input.mode !== 'location') return;

setState({
...state,
input: {
...state.input,
latitude: undefined,
longitude: undefined,
search,
},
});
};

//set search mode dropdown and clear all distances
Expand Down Expand Up @@ -164,6 +164,7 @@ export default function Controls({ state, setState, mapbox }: ControlsProps) {
state.input.mode === 'location' ? search : state.input.search
}
/>
<input type="submit" hidden />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense to add this.
Also not sure how this was working before the enter key press behavior seems sort of unpredictable currently.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think maybe because there are buttons in the

field the browser might be interpreting one of those as a submit?

{modes.length > 1 && (
<button
aria-label={strings.modes[state.input.mode]}
Expand Down