Skip to content

Commit 8ea63a7

Browse files
authored
Fix example in the documentation for "setViewportOf"
The example is using `Task.perform` instead of `Task.attempt`
1 parent c36edde commit 8ea63a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Browser/Dom.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ way the latest message is always on screen! You could do this:
251251
jumpToBottom id =
252252
Dom.getViewportOf id
253253
|> Task.andThen (\info -> Dom.setViewportOf id 0 info.scene.height)
254-
|> Task.perform (\_ -> NoOp)
254+
|> Task.attempt (\_ -> NoOp)
255255
256256
So you could call `jumpToBottom "chat-box"` whenever you add a new message.
257257

0 commit comments

Comments
 (0)