코딩짜는 일상

[iOS 오류] a태그, div type="button" 버튼 동작 안함 본문

개발일기

[iOS 오류] a태그, div type="button" 버튼 동작 안함

Remily 2022. 7. 1. 16:36
반응형

현재 우리 회사는 웹으로 작업한 페이지를 앱을 통해 보여줌으로써

일부 서비스를 제공하고 있다. (특히 이벤트 페이지)

 

그중 룰렛 이벤트 페이지를 내가 만들어 제공했는데,

이상하게도 ios에서만 버튼이 동작하지 않는 오류가 있었다.

<div type="button" data-toggle="modal" data-target="#testModal" style="text-align: center; font-weight: bold; text-decoration: underline; color: blue;"> 테스트 모달 </div>

 

 

처음에는 div type="button"이 안 먹히나보다~ 했다.

 

마침 디자인이 <a>태그랑 비슷하겠다 a태그로 수정해 봤다.

<div style="text-align: center;">
    <a data-toggle="modal" data-target="#testModal" style="font-weight: bold; text-decoration: underline; color: blue;"> 테스트 모달 </a>
</div>

 

 

결과는 여전히 무반응...

 

다른 모달 팝업 버튼은 다 먹히는데 왜 얘만 안될까 해서 봤더니

다른 버튼은 button으로 되어있길래 <button>태그로 바꿨다.

 

디자인을 a태그랑 비슷하게 가져가야 해서

스타일에 라인과 백그라운드를 투명으로 해줬다.

 

 

** 최종 **

<div style="text-align: center; font-weight: bold;">
    <button data-toggle="modal" data-target="#testModal" style="background-color: transparent; border-color: transparent; color: blue; text-decoration: underline; "> 테스트 모달 </button>
</div>

 

 

** 후기 **

여전히 왜 이런 이슈가 있었는지 모르겠다.

 

마침 ios 업데이트 한지 얼마 안 되었을 때여서 (22년 6월 2일)

막연하게 ios 업데이트 때문이 아닐까~ 추측할 뿐이다...ㅠ

반응형