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

[BUG][Tyxml] multiple a_class for a single element are not supported. #968

Open
clembu opened this issue Feb 22, 2020 · 3 comments
Open
Labels

Comments

@clembu
Copy link
Contributor

clembu commented Feb 22, 2020

Describe the bug
Given the following function:

let wrap ?(a = []) contents =
 Js_of_ocaml_tyxml.Tyxml_js.Html.(div ~a:(a_class [ "wrapper" ] :: a) contents)

calling wrap ~a:[a_class [ "some-other-class" ]] some_contents results in a structure having either only "wrapper" or "some-other-class".

Expected behavior
The classes are gathered into a single list and properly reflect the final list of attributes, without having to separate classes, event handlers, and all others, in order to bundle them all at the lowest structure-creation level.

Versions
Ocaml: 4.08.1
Js_of_ocaml-tyxml: 3.5.2

@clembu clembu added the bug label Feb 22, 2020
@hhugo
Copy link
Member

hhugo commented Mar 18, 2020

@Drup, is this something we would want to support in tyxml directly ?

@Drup
Copy link
Member

Drup commented Mar 18, 2020

I'm not sure, do you have a pragmatic solution ? I feel like we should treat attributes as an string table, instead of an association list, and ask concrete implementation to do the right thing.

@hhugo
Copy link
Member

hhugo commented Mar 18, 2020

I do not have any solution in mind, I didn't really think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants