Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ElementBinder: More that one attribute binding on same element #478

Closed
g105b opened this issue Nov 3, 2023 · 2 comments
Closed

ElementBinder: More that one attribute binding on same element #478

g105b opened this issue Nov 3, 2023 · 2 comments

Comments

@g105b
Copy link
Member

g105b commented Nov 3, 2023

I have the following code:

<time data-bind:datetime="dateTime" data-bind:text="dateTime">0000-00-00 00:00:00</time>

And when I find an object with a getDateTime() BindGetter, only the datetime attribute is bound.

g105b added a commit that referenced this issue Nov 24, 2023
@g105b
Copy link
Member Author

g105b commented Nov 30, 2023

As it turns out, the issue is not to do with the HTML attribute, but the dataset property. It probably also affects property access of the attributes.

Edit: looking deeper into this, PhpGt/Dom#448 will fix this issue.

@g105b
Copy link
Member Author

g105b commented Dec 7, 2023

To clarify, there's another issue here. Simple example below. Needs testing.

<a data-bind:text="url" data-bind:href="url" target="_blank" href="/">example.com</a>
$binder->bindData($object);

The $object has a url property, but only the first bind property is bound. In this example, the text is bound to the URL, but the href is not. If I switch the attributes' order around, then the href is bound and the text is not.

@g105b g105b self-assigned this Dec 7, 2023
g105b added a commit that referenced this issue Dec 12, 2023
g105b added a commit that referenced this issue Dec 31, 2023
@g105b g105b closed this as completed in 2762126 Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant