UI Toolkit: VisualElement.resolvedStyle missing 'overflow' style property

As of UI Toolkit 1.0.0-preview.18 the IResolvedStyle interface does not contain a definition for overflow.

This makes it impossible to determine whether or not a VisualElement has its overflow property set to hidden via USS.

UI toolkit hasn’t been a package for years. It’s built into Unity.

The actual docs are on the regular scripting reference site: Unity - Scripting API: IResolvedStyle

Thanks for clarifying that.

Same outcome, though.

So it seems! Quite the strange one and I assume it’s an oversight.

Would be worth reporting a more formal bug about this one.

I submitted a bug report.

Update 09/24/24
The bug report was closed with the following statement:

Hi,

Thanks for submitting the issue and sorry for the delayed answer.

I’ve discussed it with one of the developers, and they’ve provided some context around the missing ‘overflow’ property in the IResolvedStyle interface.

As per the developer’s explanation, the ‘overflow’ property can have more values than what is currently supported in the UI Elements namespace. In USS, users only have access to the ‘visible’ and ‘hidden’ values for this property. There is a third value called ‘scroll’ which is not actively supported at the moment. While we acknowledge that this is not an ideal situation, the ‘overflow’ property is intentionally not exposed in the IResolvedStyle interface due to these limitations.

Therefore this isn’t really a bug but more of a omission of the API, that could be improved if there would be a strong use case for it.

That said, I will be closing this ticket, but if you have further questions or additional information that would make this issue appear more severe, please feel free to contact us.

Thanks,
Izabelė
Customer QA Team

1 Like