Skip to content

Commit

Permalink
removes selected state when hovering in station selection
Browse files Browse the repository at this point in the history
  • Loading branch information
eireland committed Jan 30, 2024
1 parent 2ee45ed commit 2b5a3e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/location-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export const LocationPicker = () => {
return (
<li key={`${station}-${idx}`} data-ix={`${idx}`} value={station.station.ICAO}
className={classnames("station-selection", {"station-candidate": hoveredStationIndex === idx},
{"selected-station": station.station.name === state.weatherStation?.name})}
{"selected-station": (station.station.name === state.weatherStation?.name && hoveredStationIndex === null)})}
onMouseOver={()=>handleStationHover(idx)} onClick={(e)=>handleStationSelection(e)} onKeyDown={(e)=>handleStationSelectionKeyDown(e,idx)}>
<span className="station-distance" ref={idx === 0 ? firstStationListedRef : null} style={{width: distanceWidth}}>
{stationDistanceText.toFixed(1)} {unitDistanceText} {idx === 0 && `from ${state.location?.name}`}
Expand Down

0 comments on commit 2b5a3e7

Please sign in to comment.