arunpandit Posted April 4, 2020 Share Posted April 4, 2020 I need to show a tooltip which is a Html list on date hover. I can show the date highlighted and a simple message but the list wont show correctly. It is just a garbled mess. I even tried to add in white-space:pre, wrap, wrap-line etc but nothing seems to work. Is there any way to show a list in a tooltip on hover? Here is the code export class DatepickerDateClassExample { list : string = 'Test - Test 1 r/n' + 'Test - Test 2 r/n' + 'Test - Test 3 r/n'; constructor(private renderer: Renderer2) {} dates = [ { date: "2020-04-20", text: this.list } ]; dateClass = (d: Date) => { const dateSearch = this.dateToString(d); return this.dates.find(f => f.date == dateSearch) ? "example-custom-date-class" : undefined; }; displayMonth() { let elements = document.querySelectorAll(".endDate"); let x = elements[0].querySelectorAll(".mat-calendar-body-cell"); x.forEach(y => { const dateSearch = this.dateToString( new Date(y.getAttribute("aria-label")) ); const data = this.dates.find(f => f.date == dateSearch); if (data) y.setAttribute("aria-label", data.text); }); Quote Link to comment Share on other sites More sharing options...
arunpandit Posted April 7, 2020 Author Share Posted April 7, 2020 On 4/4/2020 at 12:14 PM, arunpandit said: I need to show a tooltip which is a Html list on date hover. I can show the date highlighted and a simple message but the list wont show correctly. It is just a garbled mess. I even tried to add in white-space:pre, wrap, wrap-line etc but nothing seems to work. Is there any way to show a list in a tooltip on hover? Here is the code new projects in mulund export class DatepickerDateClassExample { list : string = 'Test - Test 1 r/n' + 'Test - Test 2 r/n' + 'Test - Test 3 r/n'; constructor(private renderer: Renderer2) {} dates = [ { date: "2020-04-20", text: this.list } ]; new projects in kalyan dateClass = (d: Date) => { const dateSearch = this.dateToString(d); return this.dates.find(f => f.date == dateSearch) ? "example-custom-date-class" : undefined; }; displayMonth() { let elements = document.querySelectorAll(".endDate"); real estate consulting company let x = elements[0].querySelectorAll(".mat-calendar-body-cell"); flats in mahim x.forEach(y => { const dateSearch = this.dateToString( new Date(y.getAttribute("aria-label")) ); 2 bhk in thakur village const data = this.dates.find(f => f.date == dateSearch); if (data) y.setAttribute("aria-label", data.text); }); Any Updates???? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.