Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprite 이미지 크로스 브라우징 이슈 해결 #81

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

sean2337
Copy link
Collaborator

@sean2337 sean2337 commented Aug 7, 2024

Sprite 이미지 크로스 브라우징 이슈 해결


🏄🏼‍♂️‍ Summary (요약)

  • Sprite 이미지 크로스 브라우징 이슈 해결
    사파리의 경우, 스플라이트 이미지 처리에 대해 다른 방식을 가지고 있다고 합니다. 그래서 다음과 같이 인라인 형식으로 변경하여 해당 부분을 해결하였습니다.

🫨 Describe your Change (변경사항)

  • src/component/login/LoginSpriteSvg.tsx
  • src/assets/svgs/spriteSvgs/loginLogo.svg => delete

🧐 Issue number and link (참고)

📚 Reference (참조)

@sean2337 sean2337 self-assigned this Aug 7, 2024
@sean2337 sean2337 added the 🫨 bug Something isn't working label Aug 7, 2024
Copy link
Member

@leeminhee119 leeminhee119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오.. 혹시 참고 링크가 있다면 공유해주실 수 있을까요 ?! 🙇‍♀️ 자세한 내용이 궁금해요 !!

ㄴ 현우 : 2222 나도 궁그매 2222

@sean2337
Copy link
Collaborator Author

sean2337 commented Aug 7, 2024

우선은 스플라이트 이미지에서 해당 id를 찾는데 쓰이는 use태그 사용시에 href를 사용했었는데 이는 사파리에서 적용이 안된다고 합니다.
그래서 xlink:href를 사용하여 찾는걸 진행해야 한다고 합니다.
https://stackoverflow.com/questions/43961807/svg-use-not-working-in-safari

그리고 추가적으로 제꺼에서는 xlink:href 이것만 바꾸니깐 정상 작동하긴 했는데, Sprite 이미지 자체가 브라우저에서 받아오는 과정에서 CORS 에러가 발생하는 이슈들을 확인했습니다. 그래서 밖에 두지 않고, 안에 SVG를 넣는 인라인 방식으로 변경해서 관련 에러를 미리 방지하고자 했숩니당.... 어려워~~
https://issues.chromium.org/issues/41164645

Copy link
Member

@klmhyeonwoo klmhyeonwoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!! ✨

@leeminhee119
Copy link
Member

우선은 스플라이트 이미지에서 해당 id를 찾는데 쓰이는 use태그 사용시에 href를 사용했었는데 이는 사파리에서 적용이 안된다고 합니다. 그래서 xlink:href를 사용하여 찾는걸 진행해야 한다고 합니다. https://stackoverflow.com/questions/43961807/svg-use-not-working-in-safari

그리고 추가적으로 제꺼에서는 xlink:href 이것만 바꾸니깐 정상 작동하긴 했는데, Sprite 이미지 자체가 브라우저에서 받아오는 과정에서 CORS 에러가 발생하는 이슈들을 확인했습니다. 그래서 밖에 두지 않고, 안에 SVG를 넣는 인라인 방식으로 변경해서 관련 에러를 미리 방지하고자 했숩니당.... 어려워~~ https://issues.chromium.org/issues/41164645

오호... 공유 감사합니다 !! 🙇‍♀️👍

@sean2337 sean2337 merged commit 92d006b into develop Aug 7, 2024
2 checks passed
@sean2337 sean2337 deleted the feat/75/SpriteCrossBrowsing branch August 7, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🫨 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants