Open abresler opened 9 years ago
Here is the pivottable js example - same checkbox issue
packages <-
c('rpivotTable', 'materializeR', 'htmltools')
lapply(packages, library, character.only = T)
all_data <-
'https://raw.githubusercontent.com/abresler/si_hackathon/master/data/nfl/all_nfl_drafted_player_data.csv' %>%
read_csv
table <-
all_data %>%
select(-url.player, -url.year.draft) %>%
rpivotTable(rows = c('year.draft'),
cols = c('type.pos'),
vals = "selections.all_pro",
aggregatorName = "Sum",
rendererName = "Table Barchart")
title <-
c('Exploring the NFL Draft, 1936 - 2015')
table.page <-
table %>%
tagList(
materialize(),
tags$style(".rpivotTable select {display:inherit; !important}"),
tags$h5(title)
,.)
table.page %>%
html_print
With a little wrangling it appears that something in the CSS natively is not allowing it to know that a click clicks the check box, when you move the positioning to get the ugly check boxes back on the side it works again. Not sure if this is a start to an answer or not
Probably here is a much better spot than Twitter to have this discussion. This issue https://github.com/Dogfalo/materialize/issues/1376 explains the problem. A correctly formatted label
is required for the checkbox to work correctly.
This can potentially pose a problem for auto rendering.
Here is a working example in R
with htmltools
.
browsable(
tagList(
tags$input(type="checkbox", id="checkbox1")
,tags$label("for"="checkbox1", "test")
,materialize()
)
)
Yea, I am sure there is a hack but it may have to be a more overarching thing -- not sure how you feel but this really is a such a nice UI may be worth thinking about it, happy to try to help
Could employ the tasks to loop through all checkboxes and assign id
if doesn't exist and add for = id
in all the adjacent labels. Or remove the checkbox behavior, but then we would lose all the pretty.
I think the d3 js file would need to be rewritten as one answer
Your hack works! Question is there a way to do it as an override or in htmltools?
One solution would be to just override the CSS
for those known checkboxes, such as this for rpivotTable
and then we only lose the pretty checkboxes where we know they won't work.
browsable(
tagList(
tags$style(
".rpivotTable input[type='checkbox'] {
position: inherit;
left: inherit;
!important
}"
),
rpivotTable(as.data.frame(Titanic)),
materialize()
)
)
Thats a good short term solution
For d3scattermatrix change .rPivotTable to .Scattermatrix also works. Not pretty but thats ok for now!
Happening with me but I'm using the label corectlly:
<div class="input-field col s12">
<input id="taskDone" type="checkbox">
<label for="taskDone"> Done </label>
</div>
Sorry to hear. I unfortunately will no longer be able to support this repo. Thanks for using, but there has not been enough interest to justify keeping it maintained. I hope you understand.
There seems to be an issue with users selecting check boxes. It appears to have popped up in PivotTable wrappers and d3 wrappers. Here is my most recent example. Pardon the long code due to th custom function