_hyperscript
_hyperscript copied to clipboard
Bug in example code for javascript expressions
In this section: https://hyperscript.org/commands/js/#description
<button
_="on click
set text to #input.value
js(me, text)
if ('clipboard' in window.navigator) {
return navigator.clipboard.writeText(text)
.then(() => 'Copied');
.catch(() => me.parentElement.remove(me))
}
end
put message in my.innerHTML "
></button>
This example has a tiny bug - that semicolon on the line
.then(() => 'Copied');
This shouldn't be there - we're still chaining on the .catch
on the line below.