1

It's been fairly easy to include a TaxonomyWebTaggingControl on an Application page, and it seems to work without a hitch, except for one thing: the control's JavaScript code insists on sticking to a teeny suggestion container 44px in height.

I can't seem to find a way (well, a simple way) to change this height. There is a server height property but this applies to the control as a whole, not to the suggestion container, and increasing it doesn't increase the size of the suggestion container.

I'm able to get a somewhat better outcome by including the following css styles on the page:

.ms-taxonomy-suggestion-container {min-height:150px !important;}
.ms-taxonomy-suggestion-holder    {min-height:inherit !important;}

However, the height of the suggestion holder seems to be re-calculated as each character is typed in (generating a fresh search), and constantly produces an inline style with a height of 44px, no matter how many terms match. The exact same control, when on the Term Store Manager page, autosizes the suggestion holder correctly. It seems obvious that I'm missing some context, but I'm not sure what.

If you've been through these woods and know them, please let me know what I'm missing.

Thanks in advance
Josh

  • Using browser tool can you find the html and paste it as an update to the question. It will help to provide a solution faster. – Amal Hashim Jan 15 '15 at 21:13
  • Amal, good idea. I did that, so let's see if it works. Thanks – Josh Korn Jan 20 '15 at 14:35
0

After digging around in the Chrome Dev tools using the 'break on..' feature for the elements attribute modifications, I tracked the change to the prototype method Microsoft.SharePoint.Taxonomy.SuggestionContainer.prototype.setHeight in the ScriptForWebTaggingUI.js file.

You can override the Prototype with the following script (changing height = 100; to your desired height):

        $(document).ready(function () {

        SP.SOD.executeFunc('ScriptForWebTaggingUI.js', 'Microsoft.SharePoint.Taxonomy.ScriptForWebTaggingUI', overrideSetHeight);

        function overrideSetHeight() {
            Microsoft.SharePoint.Taxonomy.SuggestionContainer.prototype.setHeight = 
             function Microsoft_SharePoint_Taxonomy_SuggestionContainer$setHeight(height) {
                ULSX8o:;
                height -= 15;
                if (height < 44) {
                    height = 100;
                }
                var $v_0 = height.toString() + 'px';
                this.$2_2.style.height = $v_0;
                this.$3_2.style.height = $v_0;
            };
        }
    });
  • Nice! I'm long gone from the project, but this gives me a definite incentive to spelunk the Chrome Dev tools. – Josh Korn Feb 11 '17 at 4:33
  • Thanks. I'm glad you could benefit from the "late" information – Clinton Person Feb 11 '17 at 4:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.