Everything about Slinky -- issues, ideas for features, where it's being used, and more
shadaj on master
Update sbt-sonatype to 3.9.5 (#… (compare)
shadaj on master
Update sbt to 1.4.7 (#462) (compare)
shadaj on v0.6.7
shadaj on master
Release v0.6.7 (compare)
shadaj on master
Add dependency on Java IntelliJ… (compare)
onKeyPress
working? Looks like it never gets called.If you change your element to input
, it works fine (unless the element has focus, it won't receive any key events):
input(
onClick:= (_ => println(s"MOUSE")),
onKeyPress:= (_ => println(s"KEYBOARD"))
)
Also, onKeyPress
is deprecated (but works), so you should be using onKeyDown
(https://developer.mozilla.org/en-US/docs/Web/API/Document/keypress_event)
Is there any example for functional components depending on generic types? apparently, def component[D] = FuncionalComponent[Props[D]] {...}
is not enough
@react must annotate:
[error] - a class that extends (Stateless)Component,
[error] - an object that extends ExternalComponent(WithAttributes)(WithRefType)
[error] - an object defining a `val component = FunctionalComponent(...)`
[error] @react class RemoteDataLoaderComponent {
I have tried some variations without luck
trait RemoteDataLoaderBase[D] {
case class Props(fetcher: () => Future[D], render: D => ReactElement)
val theComponent: FunctionalComponent[Props] = FunctionalComponent[Props] { ...}
}
@react object MyProductsSummaryLoader extends RemoteDataLoaderBase[GetTrackedProductsResponse] {
val component = theComponent
}
def forceRefresh() = {
val (_, increment) = Hooks.useReducer[Int, Int](_ + _, 0)
() => increment(1)
}
Hooks.setEffect(..., "")
, which prevents the effect from running multiple times, unfortunately, I have no idea how to force such effect to run again without getting in executed indefinitely
Anyway, I ended up writing this: https://github.com/wiringbits/cazadescuentos/blob/master/lib/ui/src/main/scala/net/wiringbits/cazadescuentos/ui/components/RemoteDataLoaderBase.scala
I'm not 100% happy with the solution but it works, thanks for the help
import Modeler from 'bpmn-js/lib/Modeler';
const modeler = new Modeler({
container: $modelerContainer,
moddleExtensions: {
custom: customModdleExtension
},
keyboard: {
bindTo: document.body
}
});
type mismatch;
found : slinky.core.AttrPair[slinky.web.html._aria_attr.type]
required: slinky.core.TagMod[slinky.web.svg.svg.tag.type]
svg
you're using, you can copy/paste and customize one of the implicits to explicitly allow it in your code
role
and it prefixed it all with slinky.web.svg
and I thought, maybe there's an aria one for that