Open diver7 opened 7 months ago
Thank you for reporting @diver7 !
When I tried it in my environment, the file icons did not show up high and I could not reproduce the problem. I also thought it might be a browser issue, so I tried switching to Microsoft Edge, Google Chrome, FireFox, and Safari and it displayed fine in all browsers.
Hmmm...is it possible that a browser extension is doing something bad...?
Also, how about the following code? I added the object-fit property to try it out.
Thanks for verifying it's just me @tecchan1107 :D I have tried it in multiple browsers (Edge, Chrome, Firefox) with the same result. I also tried different tenants with the same result. I don't have any extensions on my browser so that can't be it. I tried adding object-fit to the code but that did not help either.
I dug into the page code coming back and found one thing that might be causing it. Not sure why it would be different just for me though. Here is how the page is rendered for me. Notice that the image file for the icons is 96X96 px in size for the fileTypeIcon element while the brandTypeIcon element is using the 16X16 px size.
Can you tell me what version (size) of the icon file your getting?
Thanks for the reply and the test, @diver7 !
Can you tell me what version (size) of the icon file your getting?
In my environment, brandTypeIcon was 24x24 px (16 x 1.5) and fileTypeIcon was 144x144 px (96 x 1.5).
Hmmm, I wonder why the icons are different sizes depending on the environment...
@tecchan1107, I see why I have the issue and you don't. Notice that your IMG elements have a Height and Width attribute and mine do not. By setting the height and width to 100% it will automatically resize the image the size of the container it is in. Now the next question is why do you have those attributes and I do not.
Notice that your IMG elements have a Height and Width attribute and mine do not. By setting the height and width to 100% it will automatically resize the image the size of the container it is in.
It's true! I hadn't noticed!
Now the next question is why do you have those attributes and I do not.
Sorry, I don't know about that... In this sample, fileTypeIcon is displayed with filepreview set to elmType, but I wonder if the specification is such that what is retrieved from this filepreview varies from tenant to tenant...? In any case, only Microsoft people may know. Create an issue in the following repository and maybe you will get an answer from them. https://github.com/SharePoint/sp-dev-docs
Also, instead of specifying the width in the filepreview, could it possibly be fixed by specifying the width in the div of the parent element of the filepreview? So I modified the code again. I hope you will give it a try when you have time.
After replying, I suddenly reconsidered and realized that the modified code might not solve the problem because the img width is not set to 100%...
I applied the modified code and tried removing width:100% from img in the developer tools. As I thought, the modified code seemed to be no good... Sorry😣😣
Sample (which sample are you having trouble with)
Generic Super Type
What Should Happen
File Icons should be small and square like the folder icon
What Actually Happens
Folder Icons are fine but the icon for files is really tall and skinny. Appears as though the height needs to be set.