File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ module React.DOM where
2
2
3
3
import React
4
4
5
- data DOMProps s eff props state =
5
+ data DOMProps s data Attrs aria Attrs eff props state =
6
6
Accept String
7
7
| AccessKey String
8
8
| Action String
9
9
| AllowFullScreen String
10
10
| AllowTransparency String
11
11
| Alt String
12
+ | Aria { | ariaAttrs }
12
13
| Async String
13
14
| AutoComplete String
14
15
| AutoFocus String
@@ -25,7 +26,7 @@ module React.DOM where
25
26
| ContextMenu String
26
27
| Controls String
27
28
| CrossOrigin String
28
- | Data String
29
+ | Data { | data Attrs }
29
30
| DateTime String
30
31
| Defer String
31
32
| Dir String
@@ -279,7 +280,18 @@ module React.DOM where
279
280
\ var prop = props[i]; \
280
281
\ var name = prop.ctor.substring(10); \
281
282
\ name = name[0].toLowerCase() + name.substring(1); \
282
- \ result[name] = prop.values[0]; \
283
+ \ var val = prop.values[0]; \
284
+ \ /* Until React.js handles data and aria like style*/ \
285
+ \ /* we have to unload the properties.*/ \
286
+ \ if (name === 'data' || name === 'aria') { \
287
+ \ for (var subprop in val) { \
288
+ \ if (val.hasOwnProperty(subprop)) { \
289
+ \ result[name + '-' + subprop] = val[subprop]; \
290
+ \ } \
291
+ \ } \
292
+ \ } else { \
293
+ \ result[name] = val; \
294
+ \ } \
283
295
\ } \
284
296
\ return result; \
285
297
\ } \
@@ -292,7 +304,7 @@ module React.DOM where
292
304
\ } \
293
305
\ } \
294
306
\ }"
295
- :: forall s eff props state. String -> [DOMProps s eff props state] -> [UI ] -> UI
307
+ :: forall s data Attrs aria Attrs eff props state. String -> [DOMProps s data Attrs aria Attrs eff props state] -> [UI ] -> UI
296
308
297
309
foreign import text
298
310
" function text(text) { \
You can’t perform that action at this time.
0 commit comments