vaadin / vaadin/docs

“Using a Field Strategy” documentation

Open
#4,447 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

hilla
Dominant language
AsciiDoc
Stars
38
Forks
225
Avg merge
1d 4h
Merged PRs (30d)
170

Description

Tell us about your request

I found an issue in this Lit Binder Field Strategy Docs. Using Vaadin 24.6.12.

When overriding the getFieldStrategy method and no model?: AbstractModel is given to the super call, the Checkbox value binding is broken. Changing the value in the form does result in a wrong value put in the bean:

  • true/checked is false
  • false/not checked is undefined

Suggested change in the documentation would be:

  override getFieldStrategy(element: any, model?: AbstractModel): FieldStrategy {
    if (element.localName === 'my-text-field' && model instanceof StringModel) {
      return new MyTextFieldStrategy(element);
    }
-  return super.getFieldStrategy(element);
+  return super.getFieldStrategy(element, model);
  }
}

If you think this issue is important, add a 👍 reaction to help the community and maintainers prioritize this issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked Lit Binder Field Strategy documentation and go to the “Using a Field Strategy” section. Update the example so the overridden getFieldStrategy method passes model to the superclass, then verify that the example reflects the reported Checkbox binding behavior and preserves the custom text-field strategy.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.