Ticket T1284123
Visible to All Users

Feature request: automatically fit validation message when it overflows viewport

created 5 days ago

Validation messages can overflow the viewport when editors are narrow, positioned close to the right edge of the viewport, and the validation message is too wide to fit.

I request that you add some code to automatically keep the validation message visible and inside the viewport:

If validationMessagePosition is default, bottom or top:

  • Before showing the validation message, measure the message width and determine if it will overflow the viewport.
  • If the message will overflow and the message width is less than the viewport width, align the right side of the validation message to the right side of the editor.

I've demonstrated the desired behavior in this codepen along with unsatisfactory options provided by the current validationMessagePosition.

https://codepen.io/ifugu/pen/xbxjazz?editors=1010

Answers approved by DevExpress Support

created 4 days ago

Hello Corey,

Thank you for the suggestion and sample.

While there's no direct API for this usage scenario, there is a workaround available. You can access the underlying validationMessage instance and use positionConfig to customize its position. Here's a CodePen that demonstrates this implementation. You can explore other settings of positionConfig to create a configuration(s) based on your real layout.

Currently, there are no immediate plans to publish an API for advanced positioning. However, if we choose to support this functionality in the future, we’ll update our Roadmap accordingly.

I hope this helps.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.