-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add list props to rich text in native. #18748
Changes from all commits
761e503
0fb5bfd
c26f4e7
3d176da
23e4728
2fc6d6d
bff7d16
0c4877e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -57,6 +57,18 @@ class BottomSheetCell extends Component { | |||
this.setState( { isScreenReaderEnabled } ); | ||||
} | ||||
|
||||
typeToKeyboardType( type, step ) { | ||||
let keyboardType = `default`; | ||||
if ( type === `number` ) { | ||||
if ( step && Math.abs( step ) < 1 ) { | ||||
keyboardType = `decimal-pad`; | ||||
} else { | ||||
keyboardType = `number-pad`; | ||||
} | ||||
} | ||||
return keyboardType; | ||||
} | ||||
Comment on lines
+60
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking first to have this in I'm wondering, what is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I see from the web the step prop is passed directly to HTML input element. And from what I see TextControl on native uses Cell directly, how do you see it I can use it on the TextControl level of native? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Any extra prop we pass to Cell, will be added to the Cell's internal
So if we pass Thanks for the explanation, I didn't see the prop on the |
||||
|
||||
render() { | ||||
const { | ||||
accessible, | ||||
|
@@ -80,6 +92,8 @@ class BottomSheetCell extends Component { | |||
style = {}, | ||||
getStylesFromColorScheme, | ||||
customActionButton, | ||||
type, | ||||
step, | ||||
...valueProps | ||||
} = this.props; | ||||
|
||||
|
@@ -156,6 +170,7 @@ class BottomSheetCell extends Component { | |||
pointerEvents={ this.state.isEditingValue ? 'auto' : 'none' } | ||||
onFocus={ startEditing } | ||||
onBlur={ finishEditing } | ||||
keyboardType={ this.typeToKeyboardType( type, step ) } | ||||
{ ...valueProps } | ||||
/> | ||||
) : ( | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both these props are already added further down to
Editable
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to make that work for native? Ideally all not rich text related props are directly passed to the editable element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we don't have editable on native, and all of the props need to go trough rich text.
One thing that I was thinking was to create an TagAttributes property that will go along with TagName prop and controlled by the blocks.
What do you think @ellatrix ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to create an
Editable
on native?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be possible, but it will take some considerable work to get there, and out of scope for this PR.
We basically will need to make our Native Aztec rich text component to be the Editable and respect all the API for it.
@koke and @hypest may have more thoughts about this, and when to give it to priority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I talked with @ellatrix and we agree to keep this as it is, and tackle it on a separate PR.