feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

Custom emojis all have the same fixed size

Open paulchen opened this issue 2 years ago • 9 comments

Description:

All custom emojis have a fixed width of 2.75rem and a fixed height of 2.75rem which is set via CSS.

Steps to reproduce:

  1. Add a custom emoji which has a different size than 2.75rem x 2.75rem.
  2. Write a message containing this emoji.

Expected behavior:

The custom emoji is not resized:

image

Actual behavior:

The custom emoji is resized to 2.75rem x 2.75rem:

image

Server Setup Information:

  • Version of Rocket.Chat Server: 5.1.4
  • Operating System: Debian GNU/Linux
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: ?
  • NodeJS Version: 14.19.3
  • MongoDB Version: 5.0.12

Client Setup Information

  • Desktop App or Browser Version: Chromium 106.0.5249.61 (Offizieller Build) Arch Linux (64-Bit), Firefox 105.0.1 (64-Bit)
  • Operating System: Arch Linux

Additional context

This problem was already reported in https://github.com/RocketChat/Rocket.Chat/issues/26547, but in my case I cannot use the solution mentioned there as my custom emojis have different sizes. Of course, I could make use of the fact that every custom emoji comes with its own CSS class and create a separate CSS definition for each emoji, but in my opinion this is a quite dirty solution.

I think this could be fixed by adding the attributes height and width to the span element of the emoji (this is how i created the screenshot in the section "Actual behaviour" above). During upload of a custom emoji, Rocket.Chat could save height and width of the emoji and retrieve these values when displaying it.

paulchen avatar Sep 29 '22 17:09 paulchen

Hi @paulchen! Thanks for your input.

I have tested this in 5.2.0-rc1 and it was not resized to 2.75rem x 2.75rem. Can you confirm this?

Renaming the name or alias required to upload an image again, and after uploading, it was indeed broken. So it was needed to remove the emoji and add it again.

I think this could be fixed by adding the attributes height and width to the span element of the emoji (this is how i created the screenshot in the section "Actual behaviour" above). During upload of a custom emoji, Rocket.Chat could save height and width of the emoji and retrieve these values when displaying it.

This is indeed a nice suggestion.

dudanogueira avatar Sep 29 '22 20:09 dudanogueira

Hi @dudanogueira! Thanks for for reply.

I have tested this in 5.2.0-rc1 and it was not resized to 2.75rem x 2.75rem. Can you confirm this?

I just fired up version 5.2.0-rc.1 from Docker Hub. I experienced the same behaviour as described above.

I uploaded this GIF as a custom emoji named "mb2": https://chat-dev.rueckgr.at/emoji-custom/mb2.gif

It is still resized to 2.75rem x 2.75rem. In the DevTools I can clearly see why this happens:

image

And because this style gets applied to all custom emojis, every custom emoji has the size of 2.75rem x 2.75rem.

paulchen avatar Sep 29 '22 20:09 paulchen

Oh, I am sorry. You are right! It's still an issue.

dudanogueira avatar Sep 30 '22 13:09 dudanogueira

Is anyone solving this issue? If not, @dudanogueira would you kindly assign this to me?

codewithmitesh avatar Dec 01 '22 05:12 codewithmitesh

Hi there, thanks for raising the issue! 🚀 💯

Sorry, but GitHub is only for issues/bugs, this is a improvement of the current solution, I'll transfer this to feature-request repository.


Questions? Help needed? Feature Requests?

hugocostadev avatar Apr 06 '23 11:04 hugocostadev

Hello! Any luck?

andys448 avatar Jun 05 '23 13:06 andys448

+1

Kot-o-pes avatar Feb 15 '24 08:02 Kot-o-pes

+1

swat-ordbogen avatar May 10 '24 12:05 swat-ordbogen

+1

HEPHEPHEP avatar May 16 '24 10:05 HEPHEPHEP