mapcomplete/src/Utils/selectDefault.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
318 B
TypeScript
Raw Normal View History

import { Store } from "../Logic/UIEventSource"
export function selectDefault(htmlElement: HTMLInputElement, value: Store<string>) {
if (!document.body.contains(htmlElement) || value?.data === undefined) {
return
}
if (value.data === htmlElement.value) {
htmlElement.checked = true
}
}