phpgt / phpgt/DomTemplate

data-bind:class should be able to bind multiple class names

Open
#488 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
18
Forks
4
PR merge metrics
No merged PRs in 30d

Description

<span data-bind:text="totalWeightString" data-bind:class=":overweight :oversize">0,000</span>
function go(Binder $binder):void {
    $binder->bindKeyValue("overweight", true);
    $binder->bindKeyValue("oversize", true);
}

The above HTML only binds the overweight class, not the oversize. There's no reason this shouldn't bind both.

Contributor guide

Open the contributing guide

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

Reproduce the issue with the HTML data-bind:class example and the PHP Binder setup shown in the report. Trace the data-bind:class handling to see why only the first truthy class is applied. Done means both overweight and oversize are present when both keys are true, with regression coverage for the example behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, php
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.