vue-line-clamp icon indicating copy to clipboard operation
vue-line-clamp copied to clipboard

wordBreak Option, cleaned up logic on what function to use

Open AndyDyer opened this issue 5 years ago • 22 comments

…wordBreak option and cleaned up fallBackFunc logic

AndyDyer avatar Feb 27 '19 17:02 AndyDyer

Is there any intention of merging either this or #27?

alejandroiglesias avatar Mar 22 '19 13:03 alejandroiglesias

@alejandroiglesias I'd like to but I don't have write access

AndyDyer avatar Mar 23 '19 20:03 AndyDyer

When I made this develop was out of date so I didn't know what the protocol was

AndyDyer avatar Mar 23 '19 20:03 AndyDyer

I'm fine with this. Will test it locally tomorrow.

Can you add it to the readme, please?

Frondor avatar Apr 01 '19 01:04 Frondor

Does it make sense to have wordBreak: 'break-all' on by default when it is not the browser default? It prevents proper break of phrases which would fit in. What does it accomplish?

franciscolourenco avatar Apr 01 '19 14:04 franciscolourenco

Because the ellipsis approach works better with break-all. The symbol is supposed to be at the very limit of the container, not floating to the last word that fits in. https://stackoverflow.com/questions/1795109/what-is-the-difference-between-word-break-break-all-versus-word-wrap-break

Frondor avatar Apr 01 '19 15:04 Frondor

done @Frondor

AndyDyer avatar Apr 01 '19 20:04 AndyDyer

@Frondor Can you provide an example of what you mean? When I set word-break: break-word the ellipsis seems to work exactly the same way. It still breaks works and takes advantage of all the space in the second line:

break-all Screen Shot 2019-04-02 at 11 19 08

break-word Screen Shot 2019-04-02 at 11 18 48

franciscolourenco avatar Apr 02 '19 09:04 franciscolourenco

Not that I disagree @franciscolourenco but making this change to default behavior is a breaking change, and this PR would allow people to choose their path.

AndyDyer avatar Apr 02 '19 13:04 AndyDyer

@AndyDyer That is great. You could classify this a bug, since it is not documented or expected that this plugin changes the way the words break. In that case making the default break-word would be fixing it. Otherwise the major version can be incremented.

franciscolourenco avatar Apr 02 '19 21:04 franciscolourenco

Up to @Frondor

AndyDyer avatar Apr 03 '19 03:04 AndyDyer

@Frondor any more changes?

AndyDyer avatar Apr 24 '19 16:04 AndyDyer

+1 on this please, we need it.

phouri avatar Jun 06 '19 09:06 phouri

@Frondor bump

AndyDyer avatar Jun 07 '19 02:06 AndyDyer

This is great, I could really use this as I was wondering why my word-break value wasn't being honored and it turns out that this directive hardcodes the break-all value as an inline style. I would love to be able to customize this.

@Frondor any blockers on merging this in?

do-adams avatar Jul 25 '19 20:07 do-adams

@Frondor anything holding this up? If you need help just say it

roennow avatar Nov 01 '19 08:11 roennow

Bump

Devin0231577 avatar Nov 06 '19 16:11 Devin0231577

Hello, i am also interested by this one, is there any chance this PR could go through? :)

gotson avatar Nov 20 '19 06:11 gotson

+1 on getting this PR approved and released

mezereon-co avatar Nov 27 '19 00:11 mezereon-co

Nice. Note that the default word-break: break-word; is deprecated according to the MDN.

[break-word has] the same effect as word-break: normal and overflow-wrap: anywhere, regardless of the actual value of the overflow-wrap property.

Maybe using word-break: normal; as the default and adding an overflow-wrap would be preferable?

patryk-tech avatar Dec 19 '19 10:12 patryk-tech

@Frondor Can this be merged please? This is a crucial feature to present readable text.

paulkarpenko avatar Nov 05 '21 15:11 paulkarpenko

@Frondor When this fix will be merged? The only option to use this lib now is to fork it and fix the issue locally 😔

kirillunlimited avatar Mar 14 '22 14:03 kirillunlimited