MithrilJS / MithrilJS/mithril-query
Custom style properties prevent MQ from rendering components
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 106
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
As per title, mithril query fails to render components that are passed custom style properties via mithril js syntax. For instance, declaring a component with mq such as:
const someComp = mq(someComp, { attr1: true, attr2: false, style: {"--testVar": 12}});
or within the component view such as:
return m("some-name", { style: { "--testVar": 12}}, [childrenHere...]);
...will cause the following error when running tests
TypeError: Cannot read properties of undefined (reading 'type')
However, setting up the same functionality in the same way, but adding the properties via js inside the component view()/oncreate() causes no issues.
document.querySelector(".someComp").style.setProperty("--testVar", 12);
``
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with the mq(...) examples and the style objects shown in the issue, then trace the component rendering path that produces the undefined type error. Compare custom style properties passed through mq and through the component view; done means both forms render without the TypeError and the regression is covered by a test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100