Skip to content

fix(ui): keep getter src as initial Img source - #255

Merged
linkdata merged 1 commit into
mainfrom
fix/250-img-src-precedence
Aug 7, 2026
Merged

fix(ui): keep getter src as initial Img source#255
linkdata merged 1 commit into
mainfrom
fix/250-img-src-precedence

Conversation

@linkdata

@linkdata linkdata commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • emit the getter-backed Img src before caller and getter-hook attributes so browser parsing keeps the canonical initial source
  • document getter src precedence
  • add regression coverage for both duplicate-src paths and preservation of unrelated attributes

Fixes #250

Verification

  • go generate ./...
  • go vet ./...
  • gofmt -l .
  • gofumpt -l lib/ui/img.go lib/ui/html_widgets_test.go
  • staticcheck ./...
  • golangci-lint run
  • gosec ./...
  • JAWS_REQUIRE_NODE=1 go test -race -coverprofile=coverage.out ./...
  • JAWS_REQUIRE_NODE=1 go test ./...
  • go build -v ./...
  • GOOS=linux GOARCH=386 CGO_ENABLED=0 go test -exec=/usr/bin/true ./lib/bind/...

Emit the getter-backed src before caller and getter attributes so HTML parsing retains the intended initial image. Cover both supported duplicate-attribute paths.

Fixes #250
@linkdata
linkdata merged commit b8c0b0d into main Aug 7, 2026
7 checks passed
@linkdata
linkdata deleted the fix/250-img-src-precedence branch August 7, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui: Img caller src attribute overrides getter-backed src on initial render

1 participant