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

Can't set IFrame and SVG attributes #174

Closed
heimeshoff opened this issue Apr 29, 2020 · 6 comments · Fixed by #188
Closed

Can't set IFrame and SVG attributes #174

heimeshoff opened this issue Apr 29, 2020 · 6 comments · Fixed by #188
Labels
enhancement New feature or request Feliz Issues related to Feliz good first issue Good for newcomers

Comments

@heimeshoff
Copy link

Trying to implement Youtube Videos and SVGs on a website, yet can't set some properties:

            Html.iframe [ 
              prop.className "videostream"
              prop.src v.url
              prop.allowFullScreen true // Missing Feature in Feliz?
              prop.scrolling "no" // Missing Feature in Feliz?
              prop.frameBorder 0 // Missing Feature in Feliz?

                  Html.svg [ 
                    prop.className "fill-current h-3 w-3" ; 
                    Html.svg.viewBox "0 0 20 20" // Missing Feature in Feliz?
                    Html.svg.xmlns "http://www.w3.org/2000/svg" // Missing Feature in Feliz?
                    prop.children [ 
                      Html.path [ 
                        Html.d "M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" // Missing Feature in Feliz?
                      ]
                    ]
                  ]
@Shmew
Copy link
Collaborator

Shmew commented Apr 29, 2020

Hi @heimeshoff,

The iframe attributes weren't included for these reasons:

  • allowFullScreen - legacy attribute, use allow="fullscreen", looks like allow is missing, I'll submit a PR for that one.
  • frameBorder - Deprecated API
  • scrolling - Deprecated API

As for the svg items it looks like those are missing.

@Zaid-Ajaj
Copy link
Owner

Hi @heimeshoff, indeed it looks like the svg properties are not all yet supported with Feliz. Until they become available, you can fallback to using the prop.custom function which makes the properties you want:

Html.svg [
  prop.className "fill-current h-3 w-3"
  prop.custom("viewBox", "0 0 20 20")
  prop.custom("xmlns", "http://www.w3.org/2000/svg")
  prop.children [
    Html.path [ 
        prop.custom("d", "M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z") 
    ]
  ]
]

@heimeshoff
Copy link
Author

Awesome, I'll use the workaround and check back in every now and then :)

@Zaid-Ajaj
Copy link
Owner

@heimeshoff Feel free to also send PRs adding the missing features 😉 these are more than welcome

@Shmew
Copy link
Collaborator

Shmew commented May 1, 2020

Could we leave this issue open? I don't want to lose track of the fact that we need to add these attributes.

@heimeshoff heimeshoff reopened this May 1, 2020
@Shmew Shmew added enhancement New feature or request Feliz Issues related to Feliz good first issue Good for newcomers labels May 5, 2020
@Shmew
Copy link
Collaborator

Shmew commented May 6, 2020

I created a separate issue to track this and any other missing SVG elements/attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Feliz Issues related to Feliz good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants