diff --git a/.github/pull_request_Template.md b/.github/pull_request_Template.md index e4e2c94a..21e9c73e 100644 --- a/.github/pull_request_Template.md +++ b/.github/pull_request_Template.md @@ -13,6 +13,12 @@ PR 내용을 작성해주세요.
+## Related Issues + +
+관련된 이슈 number를 작성해주세요. +
+ ## To Reveiwer
diff --git a/src/contexts/StompContext.tsx b/src/contexts/StompContext.tsx index e408227a..86a55aad 100644 --- a/src/contexts/StompContext.tsx +++ b/src/contexts/StompContext.tsx @@ -66,7 +66,9 @@ export const StompProvider: React.FC<{ children: ReactNode }> = ({ const connectChat = () => { const socket = new SockJs(process.env.REACT_APP_CHAT_URL + '/chat'); - stompClient.current = Stomp.over(socket); + stompClient.current = Stomp.over(() => { + return socket; + }); // 연결 stompClient.current.connect( { diff --git a/src/pages/Buyer/BuyerChat.tsx b/src/pages/Buyer/BuyerChat.tsx index 6ff45682..565bedfb 100644 --- a/src/pages/Buyer/BuyerChat.tsx +++ b/src/pages/Buyer/BuyerChat.tsx @@ -56,6 +56,7 @@ export const BuyerChat = () => { const [startRequestActive, setStartRequestActive] = useState(true); //useRefs const inputRef = useRef(null); //input ref 높이 초기화를 위함 + const hiddenInputRef = useRef(null); const sectionPaddingRef = useRef(2.4); // section 추가 padding bottom const { stompClient } = useStompContext(); @@ -322,7 +323,10 @@ export const BuyerChat = () => { sendMessage(); setInput(''); } - if (inputRef.current) { + if (inputRef.current && hiddenInputRef.current) { + // hiddenInput에 focus를 옮기고, 다시 input으로 옮기는 방식을 사용하여 + // ios 환경에서 한글(받침없는 글자) 입력시 buffer가 남아있는 문제를 해결했음 + hiddenInputRef.current.focus(); inputRef.current.focus(); } if (inputRef.current) inputRef.current.style.height = '2.4rem'; @@ -464,7 +468,6 @@ export const BuyerChat = () => { ref={setTarget} style={{ width: '100%', - // height: '0.1rem', backgroundColor: 'green', }} > @@ -472,7 +475,6 @@ export const BuyerChat = () => {
@@ -690,6 +692,7 @@ export const BuyerChat = () => { } }} /> +