angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

.cur cursor doesn't show in IE11/Edge, but works in Chrome

Open junjunruan opened this issue 9 years ago • 5 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.1.3 node: 6.11.0 os: win32 x64 @angular/animations: 4.3.1 @angular/common: 4.3.1 @angular/compiler: 4.3.1 @angular/core: 4.3.1 @angular/forms: 4.3.1 @angular/http: 4.3.1 @angular/platform-browser: 4.3.1 @angular/platform-browser-dynamic: 4.3.1 @angular/router: 4.3.1 @angular/cli: 1.1.3 @angular/compiler-cli: 4.3.1 @angular/language-service: 4.3.1

Repro steps.

Link to the sample repo: https://github.com/junjunruan/ng4-cli After clone the repo, use yarn start to run the app. Visit http://localhost:4200 in IE11 or Edge.

The log given by the failure.

The cursor doesn't show when mouse enter the box with bisque color. There is no error in the console.

Desired functionality.

Expected to see an IE logo cursor when mouse enter the box with bisque color.

Mention any other details that might be useful.

Below is a few things I have investigated:

  1. Before migrate to CLI tool, it works well in IE11/Edge/Chrome;
  2. In the sample repo above,
  • If visit the url in Chrome, it works well.
  • by inspecting the element on the page, get the cursor image base64 data from Chrome, IE11 and Edge, they are same. Visit this webiste: https://codebeautify.org/base64-to-image-converter from both Chrome and Edge, and then copy the same image base64 data to convert back to original image in both browsers, I can see the cursor image in Chrome, but not in Edge.
  • if go to src/styles.css, and switch to use the commented out line of code (which includes a url to the online cur file), it works well in IE11/Edge.

junjunruan avatar Jul 20 '17 18:07 junjunruan

So the problem is that IE/Edge do not support base64-encoded images. Track and upvote here. The right question here would be: how to prevent Angular CLI from inlining all/some files?

This is not possible without ejecting now. Under the hood CLI uses url-loader for doing this task, so any file <10000 bytes will be inlined. So you'll either need to eject and change limit option of url-loader to not inline any images. Or use some workaround if you don't want to eject: like using full url instead of path, putting this style directly in the template, so it won't be processed by url-loader or some other tricky approach.

devoto13 avatar Jul 20 '17 23:07 devoto13

Thanks for your quick response @devoto13

I tried to use png image as cursor in Chrome, and I got the base64 encoded data. With the online convertor (https://codebeautify.org/base64-to-image-converter), it can be converted back to its original image and display in Edge.

So I am confused about what does this sentence means: So the problem is that IE/Edge do not support base64-encoded images? Do you mean IE/Edge doesn't support all base64-encoded images or just certain types of image like cur?

junjunruan avatar Jul 21 '17 13:07 junjunruan

@junjunruan The problem is not that you can not use base64-encode image at all. The problem is that Edge does not support this particular CSS feature: cursor: url(<url>). It supports actual URL (like http://example.com/my.cur), but does not not support data URI (like data:<base64-encoded data>). And CLI will transform the path you specified into data URI if file is smaller than 10000 bytes.

devoto13 avatar Jul 21 '17 14:07 devoto13

Thanks for clarification @devoto13 Hopefully IE/Edge can fix this bug or CLI can give us more options later.

junjunruan avatar Jul 21 '17 15:07 junjunruan

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.