forked from MapComplete/MapComplete
18 lines
377 B
TypeScript
18 lines
377 B
TypeScript
|
|
import { Translation } from "../UI/i18n/Translation"
|
||
|
|
|
||
|
|
export function placeholder(htmlElement: HTMLInputElement, t: Translation) {
|
||
|
|
let destroy: () => void = undefined
|
||
|
|
|
||
|
|
t.current.map(
|
||
|
|
(label) => {
|
||
|
|
htmlElement.setAttribute("placeholder", label)
|
||
|
|
},
|
||
|
|
[],
|
||
|
|
(f) => {
|
||
|
|
destroy = f
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
return { destroy }
|
||
|
|
}
|