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

Remove ifTruthy directive #401

Closed
MapTo0 opened this issue May 16, 2019 · 0 comments · Fixed by #415
Closed

Remove ifTruthy directive #401

MapTo0 opened this issue May 16, 2019 · 0 comments · Fixed by #415
Assignees
Labels
approved This issue is approved bug This issue is a bug in the code

Comments

@MapTo0
Copy link
Member

MapTo0 commented May 16, 2019

Describe the bug
ifThruthy removes an attribute key and value if value is falsy.
lit-html updates the attribute no matter if the value is changed which causes some issues.

TODO
Test and check what would cost if we remove the custom directive and stick too lit's public APIs. (check ifDefined)

Affected components
ListItem's src property makes requests no matter if updated with a new value or not.

@ilhan007 ilhan007 added approved This issue is approved bug This issue is a bug in the code labels May 16, 2019
@ilhan007 ilhan007 self-assigned this May 16, 2019
ilhan007 added a commit that referenced this issue May 22, 2019
* Background: "ifThruthy" removes an attribute key and value if value is falsy, but it makes the templates less efficient, as lit-html updates attributes no matter, if the value is changed which causes some issues.
* Fixes: #401
* Changes:
* Rename "ifThruthy" to "ifDefined" and correct the directive logic to update only if the result of the directive is different from the previous value.
* Attributes undefined, null and empty strings are removed from DOM.
* Remove obsolete "common" partials
* Make use of boolean props syntax in lit-html
* Fix  default value for string props, the default becomes empty string or the the value, given via the defaultValue metadata key.
* Clean templates from non-existing component properties (tooltip, dir..)
* Remove type: "Active" everywhere the ui5-li is used, as it is "Active" by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This issue is approved bug This issue is a bug in the code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants