Skip to Main Content
Feature Request FR-4029
Product Area Page Components
Status CLOSED

1 Voters

Move Custom Attributes of Date Picker to the Input field

ino.laurensse Public
· Sep 26 2024

Idea Summary
With the jQuery Date Picker you could add custom attributes to the input field of the date picker. E.g. to automatically format a date while typing we use onkeyup:

The new APEX Date Picker puts Custom Attributes on <a-date-picker>, which seems rather useless (all(?) attributes can already be controlled in APEX Builder):

The idea is to move Custom Attributes to the input field of the Date Picker.

Use Case
Backwards compatibility with the jQuery Date Picker.
Consistency with other input items where Custom Attributes are added to the input field.

Note: workaround for now is to run:

$("#P63_SOME_DATE_input").attr("onkeyup","formatDate(this)");

Preferred Solution (Optional)
Custom Attributes should be added to the input field of the Date Picker.

We reviewed this idea carefully, and while it was interesting, we concluded that due to all the internal implications we need to take into account, it is unlikely to make its way into APEX.

Comments

Comments

  • john.snyders APEX Team OP 1.5 years ago

    It is intentional that custom attributes goes on the web component element. In this case it is the a-date-picker element. The point of web components is that what is inside the element is opaque and should not be accessed or manipulated. This includes adding inline event handler attributes.  We haven't used shadow dom yet but we may in the future. 

    You should only use documented APEX item instance API to work with items. We may in the future document the attributes and properties of specific web components but we haven't yet.

    It seems like what you really want is to format the date as the user types it in as a built-in option to date picker. I think we already have an idea for that. If not in the ideas app at least internally.

  • ino.laurensse OP 1.5 years ago

    It seems like what you really want is to format the date as the user types it in as a built-in option to date picker. 

    In this particular use case: yes.

    In general I think APEX should be more backwards compatible, i.e. put custom attributes on the input field. It could take many years before auto-format is implemented, even when it is “on the roadmap”.