New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Menu order should be a double #19320
Comments
Changing `Menu#order` type double and `MenuData#order` type to Double to match it with Hilla's `ViewConfig` type `number`. Fixes: #19320
@Legioth little issue hijack.. I was wondering if it would be feasible to also add a parent double param to the annotation and the hilla side pushing the menu annotation from a "just for demo purpose" to an "oh that could fit a lot of use cases". The parent double would match with a corresponding index to find the appropriate view parent while building the menu; allowing lose coupling by an ID (order has to be unique anyway) instead of the hard references like layout = Class we've seen previously in Flow. |
We have considered hierarchy support for the automatic menu but it hasn't been high enough priority to be implemented yet. I don't think it's a good idea to speculatively add some specific API before we have built the functionality that uses that API. What we should maybe do instead is to make sure it's easy for applications to add their own custom properties to the menu entry that they can then use in their own menu rendering logic. |
Your second approach sounds also reasonable! |
Changing `Menu#order` type double and `MenuData#order` type to Double to match it with Hilla's `ViewConfig` type `number`. Fixes: #19320
Changing `Menu#order` type double and `MenuData#order` type to Double to match it with Hilla's `ViewConfig` type `number`. Fixes: #19320
This ticket/PR has been released with Vaadin 24.4.0.beta3 and is also targeting the upcoming stable 24.4.0 version. |
Description of the bug
The properties in the
@Menu
annotation should correspond to themenu
property in Hilla'sViewConfig
type whereorder
is anumber
which corresponds to adouble
in Java. The purpose of allowing floating point values here is to enable fractional indexing so that you can squeeze in a menu entry between 1 and 2 by setting the order to 1.5 rather than having to re-index all existing menu entires.Expected behavior
The type of
order
in@Menu
isdouble
Versions
The text was updated successfully, but these errors were encountered: