Issue #26246: Set initial value of the hidden attr when creating copy button.

Patch by Liang-Bo Wang.