Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4745

Moodle App does not support CSS pseudo-classes in database templates

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Minor Minor
    • None
    • 4.5.0
    • Database add-on
    • MOODLE_405_STABLE

      The database activity provides a great way to collect and present structured data in courses. With the custom CSS and custom JavaScript it is possible to design usable and nicely arranged UIs for it.

      For my current database I want to hide those fields in the single view template that contain no data. For this I tried two approaches: 1. Using JavaScript to hide those HTML element by assigning them a special class. 2. Using CSS pseudo-classes like :empty and :has to hide the fields without needing JavaScript.

      Both approaches work well in the browser, but not in the App!

      Since the app will not support JavaScript (see MOBILE-3172), it would be nice, if the App would at least support those advanced CSS selectors, classes and styles.

      Here is my example for the template

      <div class="db-entry-value mt-4">
        <span class="db-entry-value-title font-weight-bold">[[Field#name]]  
        </span>
        <p class="mt-2">[[Field]]</p>
      </div>

      The corresponding CSS looks like this:

      .colleague-entry-value:has(p:empty) { display: none; }

      It would be nice, if this could be supported or if another solution were possible?! Most of my students use the app and all functions it does not support, are essentially not usable. Thanks!

            Unassigned Unassigned
            wichmann wichmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 56 minutes
                3h 56m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.