Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/go-pdfkit/reader v0.6.0
github.com/go-pdfkit/render v0.11.0
github.com/go-widgets/painter v0.11.0
github.com/go-widgets/toolkit v0.272.0
github.com/go-widgets/toolkit v0.277.0
github.com/go-widgets/webcanvas v0.1.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ github.com/go-widgets/mvvm v0.5.0 h1:o5hh6HAxbApONcbZxmyV9q12pCAPGRd6L24aS3gaCbA
github.com/go-widgets/mvvm v0.5.0/go.mod h1:Phdrd434RLxXW1D6dL1PPQH1tABwYLIN2X7jQVC4TbY=
github.com/go-widgets/painter v0.11.0 h1:xsj4zTz8B43rOZnWrx7ZsaUBMgJyvgaE/Pq2FfcG2Sw=
github.com/go-widgets/painter v0.11.0/go.mod h1:IPRLqdUJuJX8sfuHeYLZCzjoLvA0ApbOlyIAVmguJDQ=
github.com/go-widgets/toolkit v0.272.0 h1:TksXi4e3L8cuk37IfcdNgRzWFYqel+j0G7nZSLGJBTo=
github.com/go-widgets/toolkit v0.272.0/go.mod h1:eBfiAf9RI6uqmW6NoyFIBjNJgVmpjgVtVuJYS/8N5kI=
github.com/go-widgets/toolkit v0.277.0 h1:aMW3b9n+V6YY025sj327Ohs/coSHavKHz/7M5iu4+6Y=
github.com/go-widgets/toolkit v0.277.0/go.mod h1:Jgyk35WkerXSvQpQ4ZFYUywg/VLnox4s/7qCVyt4mS0=
github.com/go-widgets/webcanvas v0.1.0 h1:fSGllghHlFZSC7CBb1oetj/PKR/S3ds/piDrpr0Kmg0=
github.com/go-widgets/webcanvas v0.1.0/go.mod h1:UAoPu9dO6ZzcFFwQbVeW4Jm4X67XFKVJab9A6qWwsMM=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
Expand Down
8 changes: 8 additions & 0 deletions verbs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/go-pdfkit/extract"
"github.com/go-pdfkit/ops"
"github.com/go-pdfkit/reader"
"github.com/go-widgets/toolkit"
)

// The heights of the rows of the groups this file drives.
Expand Down Expand Up @@ -43,13 +44,20 @@ func content(t *testing.T, d *ops.Doc) []byte {
}

// typeInto puts the caret in the box on a row and types a word into it.
//
// The caret is sent to the end first. Since toolkit v0.273.0 a press puts the
// caret WHERE IT LANDS rather than after the last letter — which is what a text
// box should do — and these rows are pressed in the middle, which for a box
// that already holds a default lands before the text. Somebody adding to what
// is there goes to the end first, and so does this.
func typeInto(t *testing.T, s *state, rows []int, n int, word string) {
t.Helper()
x, y := rowAt(t, s, rows, n, 1)
press(s, x, y)
if !s.editing() {
t.Fatalf("pressing row %d did not put the caret in a box", n)
}
s.toCaret(toolkit.Event{Kind: toolkit.EventKeyDown, Code: "End"})
for _, c := range strings.Split(word, "") {
if !s.handleChar(c) {
t.Fatalf("row %d refused a character", n)
Expand Down
Loading