Skip to content

Commit

Permalink
restore state setters that are triggering table "glitch"
Browse files Browse the repository at this point in the history
  • Loading branch information
bacalj committed Aug 16, 2024
1 parent 5923296 commit 56709a0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/grasp-seasons/components/seasons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const Seasons: React.FC<IProps> = ({ lang = "en_us", initialState = {}, log = (a
const handleLatSliderChange = (event: any, ui: any) => {
setSimState(prevState => ({ ...prevState, lat: ui.value }));
setLatitude(formatLatLongNumber(ui.value));
// setLocationSearch("");
setLocationSearch("");
};

const handleLatInputChange = (event: ChangeEvent<HTMLInputElement>) => {
Expand All @@ -211,17 +211,14 @@ const Seasons: React.FC<IProps> = ({ lang = "en_us", initialState = {}, log = (a

const handleLatIncrement = (increment: number) => () => {
setSimState(prevState => ({ ...prevState, lat: prevState.lat + increment }));
// TODO: commenting these out prevents the "glitch"
// but lets test other examples of these being called and see if they are glitchy
// there might be something circular going on?
//setLatitude(formatLatLongNumber(simState.lat + increment));
//setLocationSearch("");
setLatitude(formatLatLongNumber(simState.lat + increment));
setLocationSearch("");
}

const handleLongSliderChange = (event: any, ui: any) => {
setSimState(prevState => ({ ...prevState, long: ui.value }));
//setLongitude(formatLatLongNumber(ui.value));
//setLocationSearch("");
setLongitude(formatLatLongNumber(ui.value));
setLocationSearch("");
};

const handleLongInputChange = (event: ChangeEvent<HTMLInputElement>) => {
Expand Down

0 comments on commit 56709a0

Please sign in to comment.