File tree Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export enum AnalyticsEvents {
49
49
DATEPICKER_CHANGE = 'datepicker_date_change' ,
50
50
DAYPICKER_CHANGE = 'daypicker_date_change' ,
51
51
KEYBOARD_EVENT = 'keyboard_event' ,
52
+ FOCUS_OUT = 'focus_out' ,
52
53
}
53
54
54
55
export enum AnalyticsComponentType {
@@ -68,6 +69,7 @@ export enum AnalyticsComponentType {
68
69
INPUT = 'input' ,
69
70
TEXTAREA = 'textarea' ,
70
71
TAB_NAVIGATION = 'tab_navigation' ,
72
+ RADIO = 'radio' ,
71
73
}
72
74
73
75
export interface Event {
Original file line number Diff line number Diff line change @@ -124,6 +124,18 @@ const Input = forwardRef(
124
124
type = { type }
125
125
placeholder = { placeholder }
126
126
onChange = { onInputChange }
127
+ onBlur = { ( ) => {
128
+ if ( tag ) {
129
+ tracker . track ( {
130
+ event : AnalyticsEvents . FOCUS_OUT ,
131
+ type : AnalyticsComponentType . INPUT ,
132
+ tag,
133
+ pages,
134
+ merchantId,
135
+ ip,
136
+ } ) ;
137
+ }
138
+ } }
127
139
onKeyDown = { ( e : KeyboardEvent < HTMLInputElement > ) => {
128
140
if ( e . key === 'Enter' ) {
129
141
if ( tag ) {
@@ -170,6 +182,18 @@ const Input = forwardRef(
170
182
placeholder = { placeholder }
171
183
onChange = { onInputChange }
172
184
icon = { icon }
185
+ onBlur = { ( ) => {
186
+ if ( tag ) {
187
+ tracker . track ( {
188
+ event : AnalyticsEvents . FOCUS_OUT ,
189
+ type : AnalyticsComponentType . INPUT ,
190
+ tag,
191
+ pages,
192
+ merchantId,
193
+ ip,
194
+ } ) ;
195
+ }
196
+ } }
173
197
onKeyDown = { ( e : KeyboardEvent < HTMLInputElement > ) => {
174
198
if ( tag ) {
175
199
if ( e . key === 'Enter' ) {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const Radio = ({
40
40
if ( tag ) {
41
41
tracker . track ( {
42
42
event : AnalyticsEvents . RADIOBUTTON_SELECT ,
43
- type : AnalyticsComponentType . CHECKBOX ,
43
+ type : AnalyticsComponentType . RADIO ,
44
44
tag,
45
45
pages,
46
46
merchantId,
Original file line number Diff line number Diff line change @@ -50,6 +50,18 @@ const TextArea = ({ tag = '', ...rest }: Props) => (
50
50
} ) ;
51
51
}
52
52
} }
53
+ onBlur = { ( ) => {
54
+ if ( tag ) {
55
+ tracker . track ( {
56
+ event : AnalyticsEvents . FOCUS_OUT ,
57
+ type : AnalyticsComponentType . TEXTAREA ,
58
+ tag,
59
+ pages,
60
+ merchantId,
61
+ ip,
62
+ } ) ;
63
+ }
64
+ } }
53
65
{ ...rest }
54
66
/>
55
67
) }
You can’t perform that action at this time.
0 commit comments