Skip to content

Commit f83ce11

Browse files
committed
fix(react): fix focusable view container error (#4243)
* fix(react): fix focusable view container error * fix(react): add focusable demo * feat(react): focusable support view container
1 parent 574c5b7 commit f83ce11

File tree

2 files changed

+6
-4
lines changed
  • driver/js

2 files changed

+6
-4
lines changed

driver/js/examples/hippy-react-demo/src/components/Focusable/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ export default class FocusableExpo extends React.Component {
2929
focusStyle={{ backgroundColor: 'red' }}
3030
noFocusStyle={{ backgroundColor: 'blue' }}
3131
>
32+
<View style={{ flex: 1 }}>
3233
<Text style={{ color: 'white' }}>
3334
{clickindex === index ? `我被点击了${index}` : `没有被点击${index}`}
3435
</Text>
36+
</View>
3537
</Focusable>
3638
</View>
3739
);

driver/js/packages/hippy-react/src/components/focusable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ class Focusable extends React.Component<FocusableProps, FocusableState> {
118118
}
119119

120120
return React.cloneElement(child as any, {
121-
nextFocusDownId,
122-
nextFocusUpId,
123-
nextFocusLeftId,
124-
nextFocusRightId,
121+
nextFocusDownId: nextFocusDown,
122+
nextFocusUpId: nextFocusUp,
123+
nextFocusLeftId: nextFocusLeft,
124+
nextFocusRightId: nextFocusRight,
125125
requestFocus,
126126
onClick,
127127
focusable: true,

0 commit comments

Comments
 (0)