Closed (fixed)
Project:
Material Icons
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2023 at 17:07 UTC
Updated:
21 Sep 2023 at 16:34 UTC
Jump to comment: Most recent
Comments
Comment #4
gillesv commentedThanks for implementing this.
You probably know the icons don't preview yet in the autocomplete dropdown, but another thing I'd like to mention:
The way it is implemented now, you can't change the weight/grade/optical size of the icons like you can on https://fonts.google.com/icons, via font-variation-settings (CSS).
You can fix this by changing the URL of the fonts to this:
Comment #5
mabho commented@gillesv, the icons are previewed inside the autocomplete dropdown as you type, not after you actually select it. Is this what you mean? Once selected, what you see is the textual representation of the icon.
Thank you for providing insight on the weight/grade/optical size of the icons, I will try to take a look at it.
Comment #6
mabho commented@gillesv, I think I know what you mean. When you switch from a Material Icons to a Material Symbols library, there is a delay in loading the library that causes the icons to briefly show as text (it will probably depend on the quality of the user's connection). Once the library completes loading, the browser replaces the text with the icon itself.
While I agree this is not ideal, this is possibly scope for a separate ticket.
Comment #7
mabho commented@gillesv, I replaced the libraries per your suggestion.
Comment #8
gillesv commentedThanks a lot @mahbo!
About the icon preview issue in the autocomplete dropdown:
I mean that in my setup the autocomplete dropdown doesn't show the icons when using the autocomplete search function in CKEditor (5). It only shows the labels of the icons. BUT I did some more testing and notice that this issue only occurs when you haven't switched between Icon Types.
So to reproduce this issue:
This problem does not seem to occur when multiple families are allowed and you switch between Icon Types. I guess some necessary things only gets loaded after an ajax event occurs, and not at initialisation?
I'm using Drupal 10.1.2 with CKEditor 5 and the Material Icons button.
Comment #9
mabho commentedThank you for providing the details for reproducing the issue you have experienced, @gillesv.
I believe I will be able to look into this again within 2 ~ 3 weeks from now.
Comment #10
mabho commented@gillesv,
I double-checked the issue you mentioned with the WYSIWYG overlay. I cannot reproduce this problem, though. What I seem to notice is the same I mentioned in comment #6: "There is a delay in loading the library that causes the icons to briefly show as text". As I start typing, the corresponding icon name/title is displayed for the instances found. At the very first moment, the icon is indeed not displayed, but soon afterward it renders.
This is how the module has been working up-to-date, and I don't think the fix/adjustment/improvement you mention here should be tackled as part of the current issue thread.
Comment #11
mabho commentedComment #12
gillesv commentedHi @mahbo,
This is what I'm seeing in my setup:
Comment #13
gillesv commentedThe issue seems to be that in the "buildForm" function of IconDialog.php, the form value "family" is null when the form is initialized. This can be fixed as follows:
I commented the changes I would implement in the buildForm function of IconDialog.php.
Comment #14
mabho commented@gillesv, thank you for the code provided above, this totally makes sense. I have applied the suggested changes and pushed the latest commit to the repo. Feel free to test it again and confirm it now works as expected/desired.
Comment #15
b_sharpe commentedLooks good, lets get this in and work out issues/features in new tickets
Comment #17
b_sharpe commentedThanks!