Probable bug in horizontalLayout components spacing

This basic example show that clicking on erase button while the text field is empty it’s all right, if the text field contain
some text, when the erase event clear the textField’s value, the spacing shift the button out of the layout.

    private TextField textField;
    
    @Override
    protected void init(VaadinRequest vaadinRequest) {
        HorizontalLayout panel = new HorizontalLayout();
        panel.setCaption("Some Caption");
        panel.setWidth("100%");
        
        textField = new TextField() ;
        textField.setWidth("100%");
        
        Button eraseButton = new Button();
        eraseButton.setIcon(VaadinIcons.ERASER);
        eraseButton.addClickListener(this::doClear);
        
        panel.addComponents(textField, eraseButton);
        panel.setExpandRatio(textField, 1);
        
        setContent(panel);
    }

    private void doClear(ClickEvent event) {
        textField.clear();
    }

Affirmative. That’s bug.

https://github.com/vaadin/framework/issues/9723