strip formatting from button text
This commit is contained in:
@@ -163,8 +163,14 @@ function draftyFormatter(style, data, values, key) {
|
|||||||
case 'BN':
|
case 'BN':
|
||||||
// Button
|
// Button
|
||||||
attr.onClick = this.handleFormButtonClick;
|
attr.onClick = this.handleFormButtonClick;
|
||||||
|
let inner = React.Children.map(values, (child) => {
|
||||||
|
return typeof child == 'string' ? child : undefined;
|
||||||
|
}
|
||||||
|
if (!inner || inner.length == 0) {
|
||||||
|
inner = [attr.name]
|
||||||
|
}
|
||||||
// Get text which will be sent back when the button is clicked.
|
// Get text which will be sent back when the button is clicked.
|
||||||
attr['data-title'] = (React.Children.map(values, (child) => {return child;}) || [attr.name]).join('');
|
attr['data-title'] = inner.join('');
|
||||||
break;
|
break;
|
||||||
case 'FM':
|
case 'FM':
|
||||||
// Form
|
// Form
|
||||||
|
|||||||
Reference in New Issue
Block a user