Ionic 4: -webkit-line-clamp property not applying on inital load

女生的网名这么多〃 提交于 2020-04-30 11:44:36

问题


Within my Ionic 4 application, I am using -webkit-line-clamp: 2 to limit the characters displayed like so:

Example of -webkit-line-clamp working

The CSS used is:

// CSS used to limit characters
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;

// Other CSS properties
font-size: 14px;
font-weight: 600;
text-decoration: none;
line-height: 16px;
padding: 5px 5px 0 5px;
margin-bottom: 5px;
min-height: 38px;
text-decoration: none;
color: black;

However, when the page is loaded initially. The clamp isn't being applied in the view resulting in this (Though the other CSS properties are still being applied):

Example of -webkit-line-clamp not working on inital load

The page requires to be refreshed with ion-refresher to have the clamp be applied

Additionally, within the Chrome Devtools. The initial loading of the page show that the CSS properties are listed but the clamp is only applied when I toggle the -webkit-line-clamp property off and on:

CSS properties in Chrome Devtools

Does anyone know of a solution/workaround for this issue as well as what could be the cause of this issue?

Versions:
Ionic: 4.11.8
Angular: 8.1.3

来源:https://stackoverflow.com/questions/59750213/ionic-4-webkit-line-clamp-property-not-applying-on-inital-load

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!