@edwardsmarkff
@edwardsmarkff
Forum Replies Created
-
AuthorPosts
-
edwardsmarkff
Participantdisregard last message please – i am going to try to see if i can get a “count” first and then try out your EXCELLENT RECOMMENDATION of using the “smart-input” instead of “smart-combo-box” when there are no line items.
thank you.
-
This reply was modified 4 years, 6 months ago by
edwardsmarkff.
-
This reply was modified 4 years, 6 months ago by
edwardsmarkff.
edwardsmarkff
Participanthi Peter – thank you for your reply.
the issue i am facing is that i am creating <span style=”text-decoration: underline;”>dynamic</span> ComboBox elements from a data source, and it is very difficult to determine ahead of time if there are going to be list items or not.
i set up an example here of what i am thinking: https://codepen.io/edwardsmarkf/pen/poayPbg
for ( let tmp in document.getElementsByTagName(‘smart-combo-box’) ) {
. . . if (!isNaN(parseInt(tmp))) {
. . . . . . . . let comboBox = document.getElementsByTagName(‘smart-combo-box’)[tmp] ;
. . . . . . . . if ( !comboBox.items.length) {
. . . . . . . . . . . . comboBox.getElementsByClassName(‘smart-drop-down-button’)[0].style.setProperty(‘display’ , ‘none’ );
. . . . . . . . . . . . // HIDE the drop-down arrows if there are no items to select
. . . . . . . . }
. . . . }
}edwardsmarkff
Participantplease try both of these, just enter “a” and return in both comboBoxes:
https://codepen.io/edwardsmarkf/pen/rNpExgO
auto-complete="none"does not seem to do anything since it still finds “Affrogato” butincremental-search-mode='equals'seems to work fine.please let me know if i am not understanding what auto-complete does. i just assumed that saying “none” would just turn it off completely…?
-
This reply was modified 4 years, 7 months ago by
edwardsmarkff.
-
This reply was modified 4 years, 7 months ago by
edwardsmarkff.
edwardsmarkff
Participantactually that is not quite true – again please, try entering just the letter “a” and hit the return key, it fills in with the coffee name “Affrogato” – i had hoped to suppress the auto-fill completely.
however i did find an easy workaround:
incremental-search-mode='equals'creates the desired behavior.edwardsmarkff
Participant>>> “Only as a temporary workaround such code could be used.”
does this mean the option may become available?
-
This reply was modified 4 years, 7 months ago by
edwardsmarkff.
edwardsmarkff
Participantok thanks – is this the best way to limit the number of characters in a combo-box?
https://codepen.io/edwardsmarkf/pen/mdpogEL
window.onload = () => {
. . for ( let results in document.getElementById(“my-smart-combo-box”).getElementsByTagName(‘INPUT’) )
. . {
. . . . let tmp = document.getElementById(“my-smart-combo-box”).getElementsByTagName(‘INPUT’)[results] ;
. . . . if ( (typeof tmp == ‘object’) && tmp.getAttribute(‘class’) == ‘smart-input’)
. . . . {
. . . . . . . . tmp.setAttribute(‘maxlength’, ‘3’);
. . . . . . . . break;
. . . . }
. . }
}-
This reply was modified 4 years, 7 months ago by
edwardsmarkff.
-
This reply was modified 4 years, 7 months ago by
edwardsmarkff.
edwardsmarkff
Participantsorry – found it (right under my nose)
https://www.htmlelements.com/demos/editor/toolbar-custom-items/
apologies for missing this.
-
This reply was modified 4 years, 6 months ago by
-
AuthorPosts