Unplanned
Last Updated: 22 May 2025 12:12 by Patrice Boissonneault
Derek
Created on: 22 May 2025 06:41
Category: Input
Type: Bug Report
0
Uncaught TypeError: Cannot read properties of null (reading 'className')

The issue occurs when setting the Enabled property to false, which triggers a JavaScript error and causes the components to break.

Code to replicate the problem

<telerik:RadTextBox ID="RadTextBox1" runat="server" Enabled="false"></telerik:RadTextBox>
2 comments
Patrice Boissonneault
Posted on: 22 May 2025 12:12
Will this fix be in next release? If so, we will wait here. We do not like workarounds. Thanks for confirming.
ADMIN
Attila Antal
Posted on: 22 May 2025 09:17

Hello Derek,

Thank you for reporting the problem! We have identified the issue in the source code and found a temporary workaround that can be used until this is fixed.

Workaround

As a workaround, you can add the following script override to the page.

Note: It is important to add the Script right after the ScriptManager/RadScriptManager declaration and not before.

<script>
    (function () {
        try {
            var original_set_enabled = Telerik.Web.UI.RadInputControl.prototype.set_enabled;
            Telerik.Web.UI.RadInputControl.prototype.set_enabled = function (value) {

                if (this._enabled !== value) {
                    this._enabled = value;

                    if (this._textBoxElement) {
                        this._textBoxElement.disabled = !this._enabled;
                    }

                    if (this.get_wrapperElement())
                        this.updateCssClass();

                    this.updateClientState();

                    if (this.get_enableAriaSupport()) {
                        this._applyAriaStateChange('disabled', !value);
                    }

                    this.raisePropertyChanged('enabled');
                }
            }
        } catch (e) {
            // There is nothing to do.
        }
    })();
</script>

 

 

Regards,
Attila Antal
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources