Skip to content

Commit 3cffb0e

Browse files
committed
docs: 2-focus-blur 충돌 해결
1 parent 66136e7 commit 3cffb0e

1 file changed

Lines changed: 3 additions & 31 deletions

File tree

2-ui/4-forms-controls/2-focus-blur/article.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# focus와 blur
22

3-
<<<<<<< HEAD
43
사용자가 폼 요소를 클릭하거나 `key:Tab` 키를 눌러 요소로 이동하면 해당 요소가 포커스(focus)됩니다. `autofocus`라는 HTML 속성을 사용해도 요소를 포커스 할 수 있는데 이 속성이 있는 요소는 페이지가 로드된 후 자동으로 포커싱 됩니다. 이 외에도 요소를 포커싱(focusing)할 수 있는 방법은 다양합니다.
5-
=======
6-
An element receives the focus when the user either clicks on it or uses the `key:Tab` key on the keyboard. There's also an `autofocus` HTML attribute that puts the focus onto an element by default when a page loads and other means of getting the focus.
7-
>>>>>>> upstream/master
84

95
요소를 포커싱한다는 것은 일반적으로 '여기에 데이터를 입력할 준비를 하라'는 것을 의미하기 때문에 요소 포커싱이 이뤄지는 순간엔 요구사항을 충족시키는 초기화 코드를 실행할 수 있습니다.
106

@@ -22,13 +18,8 @@ An element receives the focus when the user either clicks on it or uses the `key
2218

2319
예시에서 각 핸들러는 다음과 같은 역할을 합니다.
2420

25-
<<<<<<< HEAD
2621
- `blur` 핸들러에선 필드에 이메일이 잘 입력되었는지 확인하고 잘 입력되지 않은 경우엔 에러를 보여줍니다.
2722
- `focus` 핸들러에선 에러 메시지를 숨깁니다(이메일 재확인은 `blur` 핸들러에서 합니다).
28-
=======
29-
- The `blur` handler checks if the field has an email entered, and if not -- shows an error.
30-
- The `focus` handler hides the error message (on `blur` it will be checked again):
31-
>>>>>>> upstream/master
3223

3324
```html run autorun height=60
3425
<style>
@@ -115,19 +106,11 @@ The best recipe is to be careful when using these events. If we want to track us
115106
```
116107
## tabindex를 사용해서 모든 요소 포커스 하기
117108

118-
<<<<<<< HEAD
119109
대다수의 요소는 기본적으로 포커싱을 지원하지 않습니다.
120-
=======
121-
By default, many elements do not support focusing.
122-
>>>>>>> upstream/master
123110

124111
포커싱을 지원하지 않는 요소 목록은 브라우저마다 다르긴 하지만 한 가지 확실한 것은 `<button>`, `<input>`, `<select>`, `<a>`와 같이 사용자가 웹 페이지와 상호작용 할 수 있게 도와주는 요소는 `focus`, `blur`를 지원한다는 사실입니다.
125112

126-
<<<<<<< HEAD
127113
반면 `<div>`, `<span>`, `<table>`같이 무언가를 표시하는 용도로 사용하는 요소들은 포커싱을 지원하지 않습니다. 따라서 이런 요소엔 `elem.focus()` 메서드가 동작하지 않고 `focus`, `blur`이벤트도 트리거 되지 않습니다.
128-
=======
129-
On the other hand, elements that exist to format something, such as `<div>`, `<span>`, `<table>` -- are unfocusable by default. The method `elem.focus()` doesn't work on them, and `focus/blur` events are never triggered.
130-
>>>>>>> upstream/master
131114

132115
그럼에도 불구하고 포커스를 하고 싶다면 `tabindex` HTML 속성을 사용하면 됩니다.
133116

@@ -137,11 +120,7 @@ On the other hand, elements that exist to format something, such as `<div>`, `<s
137120

138121
포커싱 되는 요소 순서는 다음과 같습니다. `tabindex``1`인 요소부터 시작해 점점 큰 숫자가 매겨진 요소로 이동하고 그다음 `tabindex`가 없는 요소(평범한 `<input>` 요소 등)로 이동합니다.
139122

140-
<<<<<<< HEAD
141123
`tabindex`가 없는 요소들은 문서 내 순서에 따라 포커스가 이동합니다(기본 순서).
142-
=======
143-
Elements without matching `tabindex` are switched in the document source order (the default order).
144-
>>>>>>> upstream/master
145124

146125
그런데 `tabindex`를 사용할 땐 주의해야 할 사항이 있습니다.
147126

@@ -154,11 +133,8 @@ Elements without matching `tabindex` are switched in the document source order (
154133
예시를 살펴봅시다. 첫 번째 항목을 클릭하고 `key:Tab` 키를 눌러보세요.
155134

156135
```html autorun no-beautify
157-
<<<<<<< HEAD
158-
첫 번째 항목을 클릭하고 Tab 키를 눌러보면서 포커스 된 요소 순서를 눈여겨보세요. 참고로 탭을 많이 누르면 예시 밖으로 포커스가 이동하니, 주의하세요.
159-
=======
160-
Click the first item and press Tab. Keep track of the order. Please note that many subsequent Tabs can move the focus out of the iframe in the example.
161-
>>>>>>> upstream/master
136+
첫 번째 항목을 클릭하고 Tab 키를 눌러보면서 포커스 된 요소 순서를 눈여겨보세요.
137+
참고로 탭을 많이 누르면 예시 밖으로 포커스가 이동하니, 주의하세요.
162138
<ul>
163139
<li tabindex="1">일</li>
164140
<li tabindex="0">영</li>
@@ -242,11 +218,7 @@ Click the first item and press Tab. Keep track of the order. Please note that ma
242218

243219
## 요약
244220

245-
<<<<<<< HEAD
246-
`focus``blur` 이벤트는 각각 요소가 포커스를 받을 때, 잃을 때 발생합니다.
247-
=======
248-
Events `focus` and `blur` trigger on an element focusing/losing focus.
249-
>>>>>>> upstream/master
221+
`focus``blur` 이벤트는 각각 요소가 포커스를 받을 때와 잃을 때 발생합니다.
250222

251223
두 이벤트를 사용할 땐 다음을 유의해야 합니다.
252224
- `focus``blur` 이벤트는 버블링 되지 않습니다. 캡처링이나 `focusin`, `focusout`을 사용하면 이벤트 위임 효과를 볼 수 있습니다.

0 commit comments

Comments
 (0)