In the official documentation
says the following:
"#resizable": Controls whether the text area is resizable. Allowed values are "none", "vertical", "horizontal", or "both" (defaults to "vertical").
in this documentation we can see, that this property "#resizable" is applicable only to textarea.
Then, you can try:
function test_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
if ($form_id == 'node_page_edit_form' || $form_id == 'node_page_form') {
$form['body']['widget']['0']['#resizable']='horizontal';
//or
//$form['body']['widget']['0']['#attributes']["style"]="resize:vertical";
}
}
if you change the text format in "restricted HTML" you will see
if you want to use the "both" parameter
function test_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
if ($form_id == 'node_page_edit_form' || $form_id == 'node_page_form') {
$form['body']['widget']['0']['#resizable']='both';
}
}
if you change the text format in "restricted HTML" you will see: